-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<new>: Standard Library Header Units 'error C4430: missing type specifier' with /translateInclude #1706
Comments
The problem appears to be with This is defined by #ifndef _CRTIMP2
#if defined CRTDLL2 && defined _CRTBLD
#define _CRTIMP2 __declspec(dllexport)
#else
#define _CRTIMP2
#endif
#endif (that is, it's defined to nothing for ordinary users; it's and it's included via the chain Line 11 in 30ac440
Line 9 in 30ac440
Line 13 in 30ac440
I'm guessing this is a compiler bug related to headers defining macros that expand to nothing. |
It seems that a header unit does not "export" macros that were imported from another header unit.
[cpp.import]/5 is a bit hard to interpret, but I believe that such macros should be exported. |
Confirmed, this is a compiler bug. Thanks for the reduced test case! |
Tracked by Microsoft-internal VSO-1287222 "[modules] transitive header unit imports do not import macros" and fixed by MSVC-PR-308046 in VS 2019 16.10 Preview 2. |
Reported by @olgaark. Related to #1694.
STL/stl/inc/new
Lines 49 to 55 in 30ac440
Preprocessing
<new>
classically withcl %X_COMMON_OPTIONS% /P /TP "%X_INC%\new"
shows that this code should expand to:I'm not sure what's happening with
/translateInclude
. (If I attempt to add/P
to the/translateInclude
command line, I get an ICE where<new>
tries to include<exception>
.)The text was updated successfully, but these errors were encountered: