1 // RUN: rm -rf %t 2 // RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fmodules-local-submodule-visibility -I%S/Inputs/no-linkage -fmodule-map-file=%S/Inputs/no-linkage/module.modulemap %s -verify 3 4 #include "empty.h" 5 6 namespace NS { int n; } // expected-note {{candidate}} 7 struct Typedef { int n; }; // expected-note {{candidate}} 8 int AliasDecl; // expected-note {{candidate}} 9 int UsingDecl; // expected-note {{candidate}} 10 namespace RealNS = NS; // expected-note {{candidate}} 11 typedef int Struct; // expected-note {{candidate}} 12 enum { Variable }; // expected-note {{candidate}} 13 const int AnotherNS = 0; // expected-note {{candidate}} 14 const int Enumerator = 0; // expected-note {{candidate}} 15 static int Overloads; // expected-note {{candidate}} 16 17 // expected-note@decls.h:1 {{candidate}} 18 // expected-note@decls.h:2 {{candidate}} 19 // expected-note@decls.h:3 {{candidate}} 20 // expected-note@decls.h:4 {{candidate}} 21 // expected-note@decls.h:5 {{candidate}} 22 // expected-note@decls.h:6 {{candidate}} 23 // expected-note@decls.h:7 {{candidate}} 24 // expected-note@decls.h:8 {{candidate}} 25 // expected-note@decls.h:9 {{candidate}} 26 // expected-note@decls.h:10 {{candidate}} 27 // expected-note@decls.h:11 {{candidate}} 28 29 void use(int); use_things()30void use_things() { 31 use(Typedef().n); 32 use(NS::n); 33 use(AliasDecl); 34 use(UsingDecl); 35 use(RealNS::n); 36 use(Struct(0)); 37 use(Variable); 38 use(AnotherNS); 39 use(Enumerator); 40 use(Overloads); 41 } 42 43 #include "decls.h" 44 use_things_again()45void use_things_again() { 46 use(Typedef().n); // expected-error {{ambiguous}} 47 use(NS::n); // expected-error {{ambiguous}} 48 use(AliasDecl); // expected-error {{ambiguous}} 49 use(UsingDecl); // expected-error {{ambiguous}} 50 use(RealNS::n); // expected-error {{ambiguous}} 51 use(Struct(0)); // expected-error {{ambiguous}} 52 use(Variable); // expected-error {{ambiguous}} 53 use(AnotherNS); // expected-error {{ambiguous}} 54 use(Enumerator); // expected-error {{ambiguous}} 55 use(Overloads); // expected-error {{ambiguous}} 56 } 57