llvm-for-llvmta/tools/clang/test/CXX/basic/basic.start/basic.start.init/p2.cpp

22 lines
421 B
C++
Raw Normal View History

2022-04-25 13:02:35 +02:00
// RUN: %clang_cc1 -verify %s -pedantic-errors -std=c++11
// RUN: %clang_cc1 -verify %s -pedantic-errors -std=c++14
// expected-no-diagnostics
struct foo_t {
union {
int i;
volatile int j;
} u;
};
__attribute__((__require_constant_initialization__))
static const foo_t x = {{0}};
union foo_u {
int i;
volatile int j;
};
__attribute__((__require_constant_initialization__))
static const foo_u y = {0};