22 lines · cpp
1// RUN: %clang_cc1 -verify %s -pedantic-errors -std=c++112// RUN: %clang_cc1 -verify %s -pedantic-errors -std=c++143// expected-no-diagnostics4 5struct foo_t {6 union {7 int i;8 volatile int j;9 } u;10};11 12__attribute__((__require_constant_initialization__))13static const foo_t x = {{0}};14 15union foo_u {16 int i;17 volatile int j;18};19 20__attribute__((__require_constant_initialization__))21static const foo_u y = {0};22