diff mbox

Minor C++ PATCH to fix lookup flags

Message ID 4DA70C2B.1030904@redhat.com
State New
Headers show

Commit Message

Jason Merrill April 14, 2011, 3 p.m. UTC
When reviewing Rodrigo's patch for range-based for, I noticed that the 
flags for some calls to build_new_method_call were wrong.  Fixed thus.

Tested x86_64-pc-linux-gnu, applied to trunk.
commit ea51123767c2512840f39002d2efac52111d1a7c
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Apr 12 22:41:48 2011 -0400

    	* parser.c (cp_parser_postfix_expression): Fix flags passed to
    	build_new_method_call.
    	* semantics.c (finish_call_expr): Likewise.
diff mbox

Patch

diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 17f5850..7ffa8ba 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -5054,7 +5054,8 @@  cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
 		    = (build_new_method_call
 		       (instance, fn, &args, NULL_TREE,
 			(idk == CP_ID_KIND_QUALIFIED
-			 ? LOOKUP_NONVIRTUAL : LOOKUP_NORMAL),
+			 ? LOOKUP_NORMAL|LOOKUP_NONVIRTUAL
+			 : LOOKUP_NORMAL),
 			/*fn_p=*/NULL,
 			tf_warning_or_error));
 		  }
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index c763f81..738375c 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2114,7 +2114,8 @@  finish_call_expr (tree fn, VEC(tree,gc) **args, bool disallow_virtual,
 
       result = build_new_method_call (object, fn, args, NULL_TREE,
 				      (disallow_virtual
-				       ? LOOKUP_NONVIRTUAL : 0),
+				       ? LOOKUP_NORMAL|LOOKUP_NONVIRTUAL
+				       : LOOKUP_NORMAL),
 				      /*fn_p=*/NULL,
 				      complain);
     }