17 lines · cpp
1// RUN: %clang_cc1 -verify -std=c++2a -pedantic-errors %s2// RUN: cp %s %t3// RUN: %clang_cc1 -x c++ -std=c++2a -fixit %t4// RUN: %clang_cc1 -Wall -pedantic-errors -x c++ -std=c++2a %t5// RUN: cat %t | FileCheck %s6// UNSUPPORTED: target={{.*-zos.*}}7 8/* This is a test of the various code modification hints that only9 apply in C++2a. */10 11namespace constinit_mismatch {12 extern thread_local constinit int a; // expected-note {{declared constinit here}}13 thread_local int a = 123; // expected-error {{'constinit' specifier missing on initializing declaration of 'a'}}14 // CHECK: {{^}} constinit thread_local int a = 123;15}16 17