3 // RUN: split-file %s %t
5 // RUN: %clang_cc1 -std=c++20 %t/p7.cppm -emit-module-interface -o %t/p7.pcm
6 // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify
11 constexpr static int sv
= 43;
14 static int getValue() { return 43; }
15 int get() { return 44; }
18 static bool templ_get(T t
) { return false; }
19 typedef int typedef_type
;
20 using using_type
= int;
22 using templ_using_type
= int;
31 export
auto getReachable() {
35 export
enum E1
{ e1
};
37 export
using E2U
= E2
;
44 auto reachable
= getReachable();
45 int a
= decltype(reachable
)::sv
;
46 int b
= decltype(reachable
)::getValue();
47 int c
= reachable
.value
;
48 int d
= reachable
.get();
49 int e
= decltype(reachable
)::a
;
50 int f
= reachable
.templ_get(a
);
51 typename
decltype(reachable
)::typedef_type g
;
52 typename
decltype(reachable
)::using_type h
;
53 typename
decltype(reachable
)::template templ_using_type
<int> j
;
54 auto value
= reachable();
58 auto a
= E1::e1
; // OK, namespace-scope name E1 is visible and e1 is reachable
59 auto b
= e1
; // OK, namespace-scope name e1 is visible
60 auto c
= E2::e2
; // expected-error {{declaration of 'E2' must be imported from module}}
61 // expected-note@* {{declaration here is not visible}}
62 auto d
= e2
; // should be error, namespace-scope name e2 is not visible
63 auto e
= E2U::e2
; // OK, namespace-scope name E2U is visible and E2::e2 is reachable
64 auto f
= E3::e3
; // expected-error {{declaration of 'E3' must be imported from module 'p7' before it is required}}
65 // expected-note@* {{declaration here is not visible}}
66 auto g
= e3
; // should be error, namespace-scope name e3 is not visible
67 auto h
= decltype(func())::e3
; // OK, namespace-scope name f is visible and E3::e3 is reachable