xref: /llvm-project/clang/test/Modules/odr.cpp (revision f183848ace53f11543eaeeaaf753d190e063f4b8)
12b9e3e39SRichard Smith // RUN: rm -rf %t
247972afdSRichard Smith // RUN: %clang_cc1 -x objective-c++ -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs/odr %s -verify -std=c++11
32b9e3e39SRichard Smith 
42b9e3e39SRichard Smith // expected-error@a.h:8 {{'X::n' from module 'a' is not present in definition of 'X' provided earlier}}
52b9e3e39SRichard Smith struct X { // expected-note {{definition has no member 'n'}}
62b9e3e39SRichard Smith };
72b9e3e39SRichard Smith 
82b9e3e39SRichard Smith @import a;
988126a25SRichard Smith 
1088126a25SRichard Smith bool b = F<int>{0} == F<int>{1};
1188126a25SRichard Smith 
122b9e3e39SRichard Smith @import b;
132b9e3e39SRichard Smith 
142b9e3e39SRichard Smith // Trigger the declarations from a and b to be imported.
152b9e3e39SRichard Smith int x = f() + g();
162b9e3e39SRichard Smith 
172b9e3e39SRichard Smith // expected-note@a.h:5 {{definition has no member 'e2'}}
18dc1f0421SRichard Smith // expected-note@a.h:3 {{declaration of 'f' does not match}}
19dc1f0421SRichard Smith // expected-note@a.h:1 {{definition has no member 'm'}}
202b9e3e39SRichard Smith 
21*f183848aSPaul Robinson // expected-error@b.h:5 {{'e2' from module 'b' is not present in definition of 'E' in module 'a'}}
22dc1f0421SRichard Smith // expected-error@b.h:3 {{'Y::f' from module 'b' is not present in definition of 'Y' in module 'a'}}
23dc1f0421SRichard Smith // expected-error@b.h:2 {{'Y::m' from module 'b' is not present in definition of 'Y' in module 'a'}}
24