diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-11-13 03:52:13 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-11-13 03:52:13 +0000 |
commit | 26210db67f218f46fa8ca1e1db3ba5dbbece0e84 (patch) | |
tree | e4111c2536ff9279f5400f7558c4652172b6e3c3 /clang/test/Modules/no-linkage.cpp | |
parent | 4f82366759235f66f21b049d4350f7e5526680d9 (diff) | |
download | bcm5719-llvm-26210db67f218f46fa8ca1e1db3ba5dbbece0e84.tar.gz bcm5719-llvm-26210db67f218f46fa8ca1e1db3ba5dbbece0e84.zip |
[modules] Follow the C++ standard's rule for linkage of enumerators: they have
the linkage of the enumeration. For enumerators of unnamed enumerations, extend
the -Wmodules-ambiguous-internal-linkage extension to allow selecting an
arbitrary enumerator (but only if they all have the same value, otherwise it's
ambiguous).
llvm-svn: 253010
Diffstat (limited to 'clang/test/Modules/no-linkage.cpp')
-rw-r--r-- | clang/test/Modules/no-linkage.cpp | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/clang/test/Modules/no-linkage.cpp b/clang/test/Modules/no-linkage.cpp index 0cc808b6331..d4a9eaba403 100644 --- a/clang/test/Modules/no-linkage.cpp +++ b/clang/test/Modules/no-linkage.cpp @@ -6,21 +6,18 @@ namespace NS { int n; } // expected-note {{candidate}} struct Typedef { int n; }; // expected-note {{candidate}} int AliasDecl; // expected-note {{candidate}} -enum AlsoAnEnum { Enumerator }; // expected-note {{candidate}} int UsingDecl; // expected-note {{candidate}} // expected-note@decls.h:2 {{candidate}} // expected-note@decls.h:3 {{candidate}} // expected-note@decls.h:4 {{candidate}} // expected-note@decls.h:5 {{candidate}} -// expected-note@decls.h:6 {{candidate}} void use(int); void use_things() { use(Typedef().n); use(NS::n); use(AliasDecl); - use(Enumerator); use(UsingDecl); } @@ -30,6 +27,5 @@ void use_things_again() { use(Typedef().n); // expected-error {{ambiguous}} use(NS::n); // expected-error {{ambiguous}} use(AliasDecl); // expected-error {{ambiguous}} - use(Enumerator); // expected-error {{ambiguous}} use(UsingDecl); // expected-error {{ambiguous}} } |