Skip to content

Fix winrt_numerics treating the standard library as part of its own implementation - #1648

Open
Yexuan Xiao (YexuanXiao) wants to merge 1 commit into
microsoft:masterfrom
YexuanXiao:patch-13
Open

Yexuan Xiao (YexuanXiao) wants to merge 1 commit into
microsoft:masterfrom
YexuanXiao:patch-13

Conversation

@YexuanXiao

Copy link
Copy Markdown
Contributor

Fixes #1647.

winrt_numerics.ixx includes windowsnumerics.impl.h in the module purview as its implementation, but windowsnumerics.impl.h transitively includes other standard library headers, causing some standard library definitions to also become part of the winrt_numerics implementation. The global module fragment includes directxmath.h, directxmath.h also transitively includes standard library headers, and unlike windowsnumerics.impl.h. This causes winrt_numerics.ixx to be expanded into the following pseudocode:

module;
#include <stdheader1>
export module winrt_numerics;
#include <stdheader2>

Once stdheader1 declares a class A but A is defined in stdheader2, this violates the standard's requirements, causing the build to fail. Since MSVC is known to be non-conforming on this issue and uses a relaxed strategy, this problem was not discovered in the previous implementation.

Link to windowsnumerics.impl.h of mingw-w64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Standard library headers included inside module purview of winrt_numerics.ixx

1 participant