blob: 4679946e1a8bbaae7c51e0e70b313c5c58803d39 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
// RUN: %clang_cc1 -pedantic-errors -std=c++11 -emit-pch %s -o %t
// RUN: %clang_cc1 -pedantic-errors -std=c++11 -include-pch %t -verify %s
#ifndef HEADER_INCLUDED
#define HEADER_INCLUDED
extern thread_local int a;
extern _Thread_local int b;
extern int c;
#else
_Thread_local int a; // expected-error {{thread-local declaration of 'a' with static initialization follows declaration with dynamic initialization}}
// expected-note@7 {{previous declaration is here}}
thread_local int b; // expected-error {{thread-local declaration of 'b' with dynamic initialization follows declaration with static initialization}}
// expected-note@8 {{previous declaration is here}}
thread_local int c; // expected-error {{thread-local declaration of 'c' follows non-thread-local declaration}}
// expected-note@9 {{previous declaration is here}}
#endif
|