From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22086 invoked by alias); 17 Nov 2009 16:04:18 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 21973 invoked by uid 22791); 17 Nov 2009 16:04:17 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Message-ID: <4B02C888.5000409@redhat.com> Date: Tue, 17 Nov 2009 16:04:00 -0000 From: Sami Wagiaalla User-Agent: Thunderbird 2.0.0.17 (X11/20081009) MIME-Version: 1.0 To: Tom Tromey CC: Project Archer Subject: Re: [RFC] Koenig lookup patch 3 References: <49BABABE.9080606@redhat.com> <49F87751.8050405@redhat.com> <4A969900.6040100@redhat.com> <4AD6340F.9070108@redhat.com> <4AD63BA4.4070309@redhat.com> <4AEF2E3C.30601@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2009-q4/txt/msg00062.txt.bz2 > I was curious to know what happens when the current language is C, not > C++. Do we still attempt ADL? > With the previous patch an ADL search would have been attempted and failed. What do you think of this solution (applied to the previous patch): diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 80e09d4..a45133f 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -184,7 +184,7 @@ static int parse_number (char *, int, int, YYSTYPE *); %token STRING %token NAME /* BLOCKNAME defined below to give it higher precedence. */ -%token UNKNOWN_NAME +%token UNKNOWN_CPP_NAME %token COMPLETE %token TYPENAME %type name string_exp @@ -385,7 +385,7 @@ exp : exp '(' write_exp_elt_opcode (OP_FUNCALL); } ; -exp : UNKNOWN_NAME '(' +exp : UNKNOWN_CPP_NAME '(' { /* This could potentially be a an argument defined @@ -820,7 +820,7 @@ variable: name_not_typename } ; -space_identifier : '@' UNKNOWN_NAME +space_identifier : '@' UNKNOWN_CPP_NAME { push_type_address_space (copy_name ($2.stoken)); push_type (tp_space_identifier); } @@ -1116,12 +1116,12 @@ name : NAME { $$ = $1.stoken; } | BLOCKNAME { $$ = $1.stoken; } | TYPENAME { $$ = $1.stoken; } | NAME_OR_INT { $$ = $1.stoken; } - | UNKNOWN_NAME { $$ = $1.stoken; } + | UNKNOWN_CPP_NAME { $$ = $1.stoken; } ; name_not_typename : NAME | BLOCKNAME - | UNKNOWN_NAME + | UNKNOWN_CPP_NAME /* These would be useful if name_not_typename was useful, but it is just a fake for "variable", so these cause reduce/reduce conflicts because the parser can't tell whether NAME_OR_INT is a name_not_typename (=variable, @@ -2043,8 +2043,8 @@ yylex () if (in_parse_field && *lexptr == '\0') saw_name_at_eof = 1; - if (sym == NULL && !lookup_minimal_symbol (tmp, NULL, NULL)) - return UNKNOWN_NAME; + if (sym == NULL && !lookup_minimal_symbol (tmp, NULL, NULL) && parse_language->la_language == language_cplus) + return UNKNOWN_CPP_NAME; return NAME; }