1 // RUN: rm -rf %t 2 // RUN: mkdir -p %t 3 // RUN: split-file %s %t 4 // 5 // RUN: %clang_cc1 -std=c++20 %t/foo.cppm -emit-module-interface -o %t/foo.pcm 6 // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify 7 // 8 //--- bar.h 9 struct bar_base { 10 enum A { 11 a, 12 b, 13 c, 14 d 15 }; 16 constexpr static bool value = false; getbar_base17 static bool get() { return false; } 18 bool member_value = false; get_funcbar_base19 bool get_func() { return false; } 20 }; 21 22 template <typename T> 23 struct bar : public bar_base { 24 }; 25 26 //--- foo.cppm 27 module; 28 #include "bar.h" 29 export module foo; 30 export template <typename T> foo()31int foo() { 32 bool a = bar<T>::value; 33 bar<T>::get(); 34 bar<T> b; 35 b.member_value = a; 36 bool c = b.get_func(); 37 return bar<T>::a; 38 } 39 40 //--- Use.cpp 41 // expected-no-diagnostics 42 import foo; test()43void test() { 44 foo<int>(); 45 } 46