Microsoft seems to do this regardless of the language mode, so we must
also do it in order to be ABI compatible.
Fixes PR36125
Paths
| Differential D47956
[MS] Consder constexpr globals to be inline, as in C++17 ClosedPublic Authored by rnk on Jun 8 2018, 11:25 AM.
Details Summary Microsoft seems to do this regardless of the language mode, so we must Fixes PR36125
Diff Detail
Event Timeline
Comment Actions Can we now remove the corresponding MSVC-specific hacks elsewhere (eg, ASTContext::isMSStaticDataMemberInlineDefinition), or do we still need those for const-but-not-constexpr static data members? Comment Actions
We should be able to do that, but unfortunately it drastically changes the diagnostics we emit, as you can see from the tortured ifdefs in my test case updates. I gave up before attempting it. This revision is now accepted and ready to land.Jun 21 2018, 6:33 AM Comment Actions
Coming back to this a year later, I think I got confused. This patch is good to go, but I never landed it because I wanted to implement Richard's comment. I guess I'll go forward with this and see what breaks. The main thing seems to be that now applying dllexport to some static data members outside the class body becomes a warning instead of a hard error. So, we should be more accepting with this than we were previously. Closed by commit rL371642: [MS] Consder constexpr globals to be inline, as in C++17 (authored by rnk). · Explain WhySep 11 2019, 11:07 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 219746 cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp
cfe/trunk/test/CXX/drs/dr7xx.cpp
cfe/trunk/test/CodeGenCXX/ms-constexpr-static-data-member.cpp
cfe/trunk/test/CodeGenCXX/ms-integer-static-data-members-exported.cpp
cfe/trunk/test/CodeGenCXX/ms-integer-static-data-members.cpp
cfe/trunk/test/SemaCXX/cxx1y-variable-templates_in_class.cpp
cfe/trunk/test/SemaCXX/dllexport.cpp
cfe/trunk/test/SemaCXX/dllimport.cpp
|