+2012-04-11 Fabien Chêne <fabien@gcc.gnu.org>
+
+ PR c++/52465
+ * parser.c (cp_parser_class_name): Call strip_using_decl and
+ return the target decl.
+ * name-lookup.c (strip_using_decl): Returns NULL_TREE if the decl
+ to be stripped is NULL_TREE.
+ (qualify_lookup): Call strip_using_decl and perform some checks on
+ the target decl.
+
2012-04-11 Jason Merrill <jason@redhat.com>
PR debug/45088
/* Definitions for C++ name lookup routines.
- Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
tree
strip_using_decl (tree decl)
{
+ if (decl == NULL_TREE)
+ return NULL_TREE;
+
while (TREE_CODE (decl) == USING_DECL && !DECL_DEPENDENT_P (decl))
decl = USING_DECL_DECLS (decl);
return decl;
return false;
if ((flags & LOOKUP_PREFER_NAMESPACES) && TREE_CODE (val) == NAMESPACE_DECL)
return true;
- if ((flags & LOOKUP_PREFER_TYPES)
- && (TREE_CODE (val) == TYPE_DECL || TREE_CODE (val) == TEMPLATE_DECL))
- return true;
+ if (flags & LOOKUP_PREFER_TYPES)
+ {
+ tree target_val = strip_using_decl (val);
+ if (TREE_CODE (target_val) == TYPE_DECL
+ || TREE_CODE (target_val) == TEMPLATE_DECL)
+ return true;
+ }
if (flags & (LOOKUP_PREFER_NAMESPACES | LOOKUP_PREFER_TYPES))
return false;
/* Look through lambda things that we shouldn't be able to see. */
decl = TYPE_NAME (decl);
}
+ decl = strip_using_decl (decl);
+
/* Check to see that it is really the name of a class. */
if (TREE_CODE (decl) == TEMPLATE_ID_EXPR
&& TREE_CODE (TREE_OPERAND (decl, 0)) == IDENTIFIER_NODE
+2012-04-11 Fabien Chêne <fabien@gcc.gnu.org>
+
+ PR c++/52465
+ * g++.dg/lookup/using52.C: New.
+
2012-04-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
* lib/prune.exp (TEST_ALWAYS_FLAGS): If undefined, set to empty.