llvm-for-llvmta/tools/clang/test/SemaCXX/anonymous-union-export.cpp

8 lines
458 B
C++
Raw Normal View History

2022-04-25 13:02:35 +02:00
// RUN: %clang_cc1 -std=c++17 -fmodules-ts -emit-obj -verify -o %t.pcm %s
export module M;
export { // expected-note 2{{export block begins here}}
union { bool a; }; // expected-error {{anonymous unions at namespace or global scope must be declared 'static'}} expected-error {{declaration of 'a' with internal linkage cannot be exported}}
static union { bool a; }; // expected-error {{declaration of 'a' with internal linkage cannot be exported}}
}