xref: /minix3/external/bsd/llvm/dist/clang/test/Modules/odr.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc // RUN: rm -rf %t
2f4a2713aSLionel Sambuc // RUN: %clang_cc1 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs/odr %s -verify -std=c++11
3f4a2713aSLionel Sambuc 
4f4a2713aSLionel Sambuc // expected-error@a.h:8 {{'X::n' from module 'a' is not present in definition of 'X' provided earlier}}
5f4a2713aSLionel Sambuc struct X { // expected-note {{definition has no member 'n'}}
6f4a2713aSLionel Sambuc };
7f4a2713aSLionel Sambuc 
8f4a2713aSLionel Sambuc @import a;
9*0a6a1f1dSLionel Sambuc 
10*0a6a1f1dSLionel Sambuc bool b = F<int>{0} == F<int>{1};
11*0a6a1f1dSLionel Sambuc 
12f4a2713aSLionel Sambuc @import b;
13f4a2713aSLionel Sambuc 
14f4a2713aSLionel Sambuc // Trigger the declarations from a and b to be imported.
15f4a2713aSLionel Sambuc int x = f() + g();
16f4a2713aSLionel Sambuc 
17f4a2713aSLionel Sambuc // expected-note@a.h:5 {{definition has no member 'e2'}}
18f4a2713aSLionel Sambuc // expected-note@a.h:3 {{declaration of 'f' does not match}}
19f4a2713aSLionel Sambuc // expected-note@a.h:1 {{definition has no member 'm'}}
20f4a2713aSLionel Sambuc 
21f4a2713aSLionel Sambuc // expected-error@b.h:5 {{'E::e2' from module 'b' is not present in definition of 'E' in module 'a'}}
22f4a2713aSLionel Sambuc // expected-error@b.h:3 {{'Y::f' from module 'b' is not present in definition of 'Y' in module 'a'}}
23f4a2713aSLionel Sambuc // expected-error@b.h:2 {{'Y::m' from module 'b' is not present in definition of 'Y' in module 'a'}}
24