C++17 [dcl.link]p4:
A linkage specification does not establish a scope.
C++17 [class.union.anon]p2:
Namespace level anonymous unions shall be declared static.
The test produces a crash on master.
Differential D45884
[Sema] Fix parsing of anonymous union in language linkage specification jkorous on Apr 20 2018, 8:07 AM. Authored by
Details
C++17 [dcl.link]p4: C++17 [class.union.anon]p2: The test produces a crash on master.
Diff Detail
Event TimelineComment Actions For the record, DR154: Anonymous unions in unnamed namespaces is relevant here.
Comment Actions Volodymyr, could you please confirm that the non-anonymous vs non-inline logic makes sense to you?
Comment Actions Looks correct to me that we are checking non-anonymous namespaces. Inline namespaces are somewhat similar to anonymous namespaces but my testing shows they are working correctly and don't require any change. By "working correctly" I mean error: anonymous unions at namespace or global scope must be declared 'static'
|