summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Sema/thread-specifier.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/Sema/thread-specifier.c b/clang/test/Sema/thread-specifier.c
index 39243d1a760..d49b350667a 100644
--- a/clang/test/Sema/thread-specifier.c
+++ b/clang/test/Sema/thread-specifier.c
@@ -107,4 +107,17 @@ __thread S s;
#endif
#endif
+#ifdef __cplusplus
+struct HasCtor {
+ HasCtor();
+};
+__thread HasCtor var_with_ctor;
+#if !defined(CXX11)
+// expected-error@-2 {{initializer for thread-local variable must be a constant expression}}
+#if __cplusplus >= 201103L
+// expected-note@-4 {{use 'thread_local' to allow this}}
+#endif
+#endif
+#endif
+
__thread int aggregate[10] = {0};
OpenPOWER on IntegriCloud