]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/55801 (ICE with thread_local after ill-formed declaration)
authorPaolo Carlini <paolo@gcc.gnu.org>
Wed, 9 Jan 2013 14:43:50 +0000 (14:43 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 9 Jan 2013 14:43:50 +0000 (14:43 +0000)
/cp
2013-01-09  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/55801
* decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
of the argument is true.

/testsuite
2013-01-09  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/55801
* g++.dg/tls/thread_local-ice.C: New.

From-SVN: r195050

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

index 49e924d0196d72bf2415bf60dc83a93048704fd5..46583530161ca576b2e3cb73201bf0a706eb7d7b 100644 (file)
@@ -1,3 +1,9 @@
+2013-01-09  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/55801
+       * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
+       of the argument is true.
+
 2013-01-08  Joel Brobecker  <brobecker@adacore.com>
 
        * parser.c (cp_parser_initializer_list): Move declaration
index c5de37e434c27a65efeb11ddd1a41cbd540525ee..074cf375019484dc0f2af1f93fda2403922922e2 100644 (file)
@@ -1,7 +1,7 @@
 /* Process declarations and variables for C++ compiler.
    Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010,
-   2011, 2012 Free Software Foundation, Inc.
+   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007-2013
+   Free Software Foundation, Inc.
    Hacked by Michael Tiemann (tiemann@cygnus.com)
 
 This file is part of GCC.
@@ -2807,7 +2807,8 @@ var_defined_without_dynamic_init (tree var)
 static bool
 var_needs_tls_wrapper (tree var)
 {
-  return (DECL_THREAD_LOCAL_P (var)
+  return (!error_operand_p (var)
+         && DECL_THREAD_LOCAL_P (var)
          && !DECL_GNU_TLS_P (var)
          && !DECL_FUNCTION_SCOPE_P (var)
          && !var_defined_without_dynamic_init (var));
index 3a3e46a4c4be598014ed4dc8333f97129145d3ee..f300905689b4cfca1368924c9dd389d586695bde 100644 (file)
@@ -1,3 +1,8 @@
+2013-01-09  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/55801
+       * g++.dg/tls/thread_local-ice.C: New.
+
 2013-01-09  Andreas Schwab  <schwab@suse.de>
 
        * gcc.dg/guality/pr54693.c: Null-terminate arr.
@@ -20,7 +25,7 @@
 
 2013-01-08  Tejas Belagod  <tejas.belagod@arm.com>
 
-       * gcc.target/aarch64/vect-mull-compile.c: Explicitly scan for 
+       * gcc.target/aarch64/vect-mull-compile.c: Explicitly scan for
        instructions generated instead of number of occurances.
 
 2013-01-08  James Greenhalgh  <james.greenhalgh@arm.com>
diff --git a/gcc/testsuite/g++.dg/tls/thread_local-ice.C b/gcc/testsuite/g++.dg/tls/thread_local-ice.C
new file mode 100644 (file)
index 0000000..174aac4
--- /dev/null
@@ -0,0 +1,6 @@
+// PR c++/55801
+// { dg-options "-std=c++11" }
+// { dg-require-effective-target tls }
+
+class C;
+thread_local C O, O2 = O;   // { dg-error "incomplete" }