re PR c++/60056 ([C++11] ICE in var_defined_without_dynamic_init, at cp/decl2.c:2876...
authorPaolo Carlini <paolo.carlini@oracle.com>
Fri, 16 Jan 2015 17:47:43 +0000 (17:47 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 16 Jan 2015 17:47:43 +0000 (17:47 +0000)
2015-01-16  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/60056
* g++.dg/tls/thread_local-ice4.C: New.

From-SVN: r219760

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tls/thread_local-ice4.C [new file with mode: 0644]

index 0edc9bbf1d96b10fe11c31b77606aaa613829a98..dc3b607886063f025388ba7d51ec0d9c6f9b44d6 100644 (file)
@@ -1,9 +1,14 @@
+2015-01-16  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/60056
+       * g++.dg/tls/thread_local-ice4.C: New.
+
 2015-01-16  James Greenhalgh  <james.greenhalgh@arm.com>
 
        * g++.dg/abi/mangle-abi-crypto.C: Add crypto options, rather
        than Neon options.
 
-2014-01-16  Paolo Carlini  <paolo.carlini@oracle.com>
+2015-01-16  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/62276
        * g++.dg/cpp0x/vt-62276.C: New.
diff --git a/gcc/testsuite/g++.dg/tls/thread_local-ice4.C b/gcc/testsuite/g++.dg/tls/thread_local-ice4.C
new file mode 100644 (file)
index 0000000..c49477b
--- /dev/null
@@ -0,0 +1,19 @@
+// PR c++/60056
+// { dg-do compile { target c++11 } }
+// { dg-require-effective-target tls }
+
+template<typename T>
+class Foo {
+public:
+    Foo() {
+        ++c;
+    }
+private:
+    thread_local static int c;
+};
+
+template<typename T> thread_local int Foo<T>::c(0);
+
+int main(){
+    Foo<int> o;
+}