OSDN Git Service

PR c++/50303
[pf3gnuchains/gcc-fork.git] / gcc / cp / parser.c
index 4c85355..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;
        }
     }
@@ -12722,7 +12728,7 @@ cp_parser_template_name (cp_parser* parser,
      its name; we will look it up again during template instantiation.  */
   if (DECL_FUNCTION_TEMPLATE_P (decl) || !DECL_P (decl))
     {
-      tree scope = CP_DECL_CONTEXT (get_first_fn (decl));
+      tree scope = ovl_scope (decl);
       if (TYPE_P (scope) && dependent_type_p (scope))
        return identifier;
     }
@@ -17424,11 +17430,8 @@ cp_parser_ctor_initializer_opt_and_function_body (cp_parser *parser)
      cp_parser_function_body changed its state.  */
   if (check_body_p)
     {
-      list = body;
-      if (TREE_CODE (list) == BIND_EXPR)
-       list = BIND_EXPR_BODY (list);
-      if (TREE_CODE (list) == STATEMENT_LIST
-         && STATEMENT_LIST_TAIL (list) != NULL)
+      list = cur_stmt_list;
+      if (STATEMENT_LIST_TAIL (list))
        last = STATEMENT_LIST_TAIL (list)->stmt;
     }
   /* Parse the function-body.  */
@@ -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