1 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %s -o %t.0.pcm -verify -DTEST=0
2 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %s -o %t.1.pcm -verify -DTEST=1
3 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %s -fmodule-file=foo=%t.0.pcm -o %t.2.pcm -verify -DTEST=2
4 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %s -fmodule-file=foo=%t.0.pcm -o %t.3.pcm -verify -Dfoo=bar -DTEST=3
6 #if TEST == 0 || TEST == 2
7 // expected-no-diagnostics
20 constexpr int *p = &n;
31 int use_a = a; // expected-error {{use of undeclared identifier 'a'}}
34 import foo; // expected-error {{imports must immediately follow the module declaration}}
38 ; // No diagnostic after P2615R1 DR
41 static_assert(true); // No diagnostic after P2615R1 DR
44 int use_b = b; // expected-error{{use of undeclared identifier 'b'}}
45 int use_n = n; // FIXME: this should not be visible, because it is not exported
48 static_assert(&n != p); // expected-error{{use of undeclared identifier 'p'}}
53 export int n; // expected-error {{expected member name or ';'}}
54 export static int n; // expected-error {{expected member name or ';'}}
58 // FIXME: Exports of declarations without external linkage are disallowed.
59 // Exports of declarations with non-external-linkage types are disallowed.
61 // Cannot export within another export. This isn't precisely covered by the
62 // language rules right now, but (per personal correspondence between zygoloid
63 // and gdr) is the intent.
65 export { // expected-note {{export block begins here}}
67 namespace NestedExport {
68 export { // expected-error {{export declaration appears within another export declaration}}
71 } // namespace NestedExport