aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorAndrew Pinski <andrew_pinski@playstation.sony.com>2009-01-15 22:10:24 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2009-01-15 14:10:24 -0800
commita2712544dcf3e154674455f0143c3a5974011b61 (patch)
tree5887a2bd84d900e1c7d9f83d6f2f02ce436da8ee /gcc/cp/decl.c
parent574af2d680da3388a6b26afa549e5306602aa8f7 (diff)
downloadgcc-a2712544dcf3e154674455f0143c3a5974011b61.zip
gcc-a2712544dcf3e154674455f0143c3a5974011b61.tar.gz
gcc-a2712544dcf3e154674455f0143c3a5974011b61.tar.bz2
re PR c++/29388 (ICE with invalid nested name specifier)
2009-01-15 Andrew Pinski <andrew_pinski@playstation.sony.com> PR C++/29388 * decl.c (grokdeclarator): Check for a non namespace/class context. 2009-01-15 Andrew Pinski <andrew_pinski@playstation.sony.com> PR C++/29388 * g++.dg/template/error37.C: New testcase. From-SVN: r143411
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index c6ed22d..8476959 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -9285,6 +9285,13 @@ grokdeclarator (const cp_declarator *declarator,
"declared out of global scope", name);
}
+ if (ctype != NULL_TREE
+ && TREE_CODE (ctype) != NAMESPACE_DECL && !MAYBE_CLASS_TYPE_P (ctype))
+ {
+ error ("%q#T is not a class or a namespace", ctype);
+ ctype = NULL_TREE;
+ }
+
if (ctype == NULL_TREE)
{
if (virtualp)