Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Modules / derived_class.cpp
blobee9e0ae4637ec725aa5502656a1917d9eedb8533
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 {
16 constexpr static bool value = false;
17 static bool get() { return false; }
18 bool member_value = false;
19 bool get_func() { return false; }
22 template <typename T>
23 struct bar : public bar_base {
26 //--- foo.cppm
27 module;
28 #include "bar.h"
29 export module foo;
30 export template <typename T>
31 int 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;
40 //--- Use.cpp
41 // expected-no-diagnostics
42 import foo;
43 void test() {
44 foo<int>();