[llvm-commits] [llvm-gcc-4.2] r101204 - /llvm-gcc-4.2/trunk/gcc/cp/decl.c
Stuart Hastings
stuart at apple.com
Tue Apr 13 18:31:38 PDT 2010
Author: stuart
Date: Tue Apr 13 20:31:38 2010
New Revision: 101204
URL: http://llvm.org/viewvc/llvm-project?rev=101204&view=rev
Log:
Prevent a very unlikely ICE in the presence of an ungrammatical test fragment. Radar 7212824.
Modified:
llvm-gcc-4.2/trunk/gcc/cp/decl.c
Modified: llvm-gcc-4.2/trunk/gcc/cp/decl.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/decl.c?rev=101204&r1=101203&r2=101204&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/cp/decl.c (original)
+++ llvm-gcc-4.2/trunk/gcc/cp/decl.c Tue Apr 13 20:31:38 2010
@@ -2210,9 +2210,11 @@
union { int i; };
is invalid. */
- if (DECL_ANON_UNION_VAR_P (newdecl)
- || DECL_ANON_UNION_VAR_P (olddecl))
- return "redeclaration of %q#D";
+ if (TREE_CODE (olddecl) == VAR_DECL
+ && TREE_CODE (newdecl) == VAR_DECL
+ && (DECL_ANON_UNION_VAR_P (newdecl)
+ || DECL_ANON_UNION_VAR_P (olddecl)))
+ return "redeclaration of %q#D";
/* If at least one declaration is a reference, there is no
conflict. For example:
More information about the llvm-commits
mailing list