From 92ac31f12b1eabf119300ac67f31480fa04f8677 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 27 Jul 1998 14:38:11 +0000 Subject: [PATCH] parse.y (direct_notype_declarator): Add precedence declaration to notype_unqualified_id case. * parse.y (direct_notype_declarator): Add precedence declaration to notype_unqualified_id case. * tree.c (ovl_member): Fix for single function in OVL. From-SVN: r21417 --- gcc/cp/ChangeLog | 7 +++++++ gcc/cp/parse.c | 4 ++-- gcc/cp/parse.y | 4 +++- gcc/cp/tree.c | 6 +++--- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d707577883f..254e5e99eda 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +1998-07-27 Jason Merrill + + * parse.y (direct_notype_declarator): Add precedence declaration + to notype_unqualified_id case. + + * tree.c (ovl_member): Fix for single function in OVL. + 1998-07-27 Dave Brolley * c-lex.c (yylex): Fix boundary conditions in character literal and diff --git a/gcc/cp/parse.c b/gcc/cp/parse.c index 04e517f7c30..cf34b9885e9 100644 --- a/gcc/cp/parse.c +++ b/gcc/cp/parse.c @@ -1378,12 +1378,12 @@ static const short yytable[] = { 59, 1224, 704, -340, 1205, 1531, 673, 421, 93, 72, 1133, 245, 389, 55, 1518, 936, -566, 756, 934, 898, 611, 612, 26, 1015, 937, 938, 438, 440, 1547, 1562, 58, - 793, -340, -349, 349, 15, 421, 46, 435, 559, 422, + 793, -340, -349, 349, 15, 421, 46, 435, -286, 422, 1508, 943, 681, 130, 131, 989, 1139, 101, 94, 1225, 152, 95, 110, 111, 58, 115, 953, 687, 978, 293, 939, -566, 174, 1478, 1421, -349, 138, 1285, 422, -349, 1084, 209, 667, 668, -134, 26, 1484, 1394, 990, 209, - 677, 107, 991, 436, 560, -286, 1400, 1401, 979, 1402, + 677, 107, 991, 436, -286, -286, 1400, 1401, 979, 1402, 613, 958, 580, -606, 154, 209, 108, 232, 218, -279, 645, 572, -349, 954, 112, 113, 955, 607, -809, 109, 910, 351, 355, 460, 463, 992, 1286, 482, 157, 516, diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y index c5acf27b22b..1113c15ba95 100644 --- a/gcc/cp/parse.y +++ b/gcc/cp/parse.y @@ -1317,7 +1317,9 @@ notype_template_declarator: direct_notype_declarator: complex_direct_notype_declarator - | notype_unqualified_id + /* This precedence declaration is to prefer this reduce + to the Koenig lookup shift in primary, below. I hate yacc. */ + | notype_unqualified_id %prec '(' | notype_template_declarator | '(' expr_or_declarator ')' { $$ = finish_decl_parsing ($2); } diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 02243282e5e..dce01cb6724 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1430,10 +1430,10 @@ ovl_member (fn, ovl) tree fn; tree ovl; { - if (fn == ovl) - return 1; - if (!ovl || TREE_CODE (ovl) != OVERLOAD) + if (ovl == NULL_TREE) return 0; + if (TREE_CODE (ovl) != OVERLOAD) + return decls_match (ovl, fn); for (; ovl; ovl = OVL_CHAIN (ovl)) if (decls_match (OVL_FUNCTION (ovl), fn)) return 1; -- 2.30.2