===================================================================
@@ -3,7 +3,7 @@
building RTL. These routines are used both during actual parsing
and during the instantiation of template functions.
- Copyright (C) 1998-2012 Free Software Foundation, Inc.
+ Copyright (C) 1998-2013 Free Software Foundation, Inc.
Written by Mark Mitchell (mmitchell@usa.net) based on code found
formerly in parse.y and pt.c.
@@ -3290,8 +3290,9 @@ finish_id_expression (tree id_expression,
}
tree wrap;
- if (TREE_CODE (decl) == VAR_DECL
- && !cp_unevaluated_operand
+ if (! error_operand_p (decl)
+ && TREE_CODE (decl) == VAR_DECL
+ && ! cp_unevaluated_operand
&& DECL_THREAD_LOCAL_P (decl)
&& (wrap = get_tls_wrapper_fn (decl)))
{
===================================================================
@@ -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" }