OSDN Git Service

2012-04-15 Fabien ChĂȘne <fabien@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / cp / parser.c
index 3e2be97..5bff67d 100644 (file)
@@ -1,6 +1,6 @@
 /* C++ Parser.
    Copyright (C) 2000, 2001, 2002, 2003, 2004,
-   2005, 2007, 2008, 2009, 2010, 2011  Free Software Foundation, Inc.
+   2005, 2007, 2008, 2009, 2010, 2011, 2012  Free Software Foundation, Inc.
    Written by Mark Mitchell <mark@codesourcery.com>.
 
    This file is part of GCC.
@@ -3581,7 +3581,13 @@ lookup_literal_operator (tree name, VEC(tree,gc) *args)
                                       TREE_TYPE (tparm))))
                found = false;
            }
-         if (found)
+         if (found
+             && ix == VEC_length (tree, args)
+             /* May be this should be sufficient_parms_p instead,
+                depending on how exactly should user-defined literals
+                work in presence of default arguments on the literal
+                operator parameters.  */
+             && argtypes == void_list_node)
            return fn;
        }
     }
@@ -13122,9 +13128,6 @@ cp_parser_explicit_instantiation (cp_parser* parser)
       tree type;
 
       type = check_tag_decl (&decl_specifiers);
-      if (decl_specifiers.attributes)
-       warning (OPT_Wattributes,
-                "attributes ignored on explicit type instantiation");
       /* Turn access control back on for names used during
         template instantiation.  */
       pop_deferring_access_checks ();
@@ -17838,6 +17841,8 @@ cp_parser_class_name (cp_parser *parser,
        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