From 584672eef4775f2ceaaa390e6d9757898077ae2c Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Thu, 10 Jul 2003 19:19:09 +0000 Subject: [PATCH] re PR c++/9411 ([New parser] Template function lookup problem) PR c++/9411 * parser.c (cp_parser_postfix_expression): Check dependency of functions. PR c++/9411 * g++.dg/template/explicit2.C: New test. From-SVN: r69196 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/parser.c | 1 + gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/g++.dg/template/explicit2.C | 10 ++++++++++ 4 files changed, 20 insertions(+) create mode 100644 gcc/testsuite/g++.dg/template/explicit2.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e91e535c18b..1d64a22e497 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2003-07-10 Mark Mitchell + + PR c++/9411 + * parser.c (cp_parser_postfix_expression): Check dependency of + functions. + 2003-07-09 Mark Mitchell PR c++/10032 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 60ec0694755..8a76eac0b70 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -3846,6 +3846,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p) && (type_dependent_expression_p (instance) || (!BASELINK_P (fn) && TREE_CODE (fn) != FIELD_DECL) + || type_dependent_expression_p (fn) || any_type_dependent_arguments_p (args))) { postfix_expression diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 100c0edf7c9..363378c0336 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2003-07-10 Mark Mitchell + PR c++/9411 + * g++.dg/template/explicit2.C: New test. + PR c++/10032 * g++.dg/warn/pedantic1.C: New test. diff --git a/gcc/testsuite/g++.dg/template/explicit2.C b/gcc/testsuite/g++.dg/template/explicit2.C new file mode 100644 index 00000000000..79941cd8ed5 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/explicit2.C @@ -0,0 +1,10 @@ +struct X { + template void foo(B); +}; + +template +void bar() { + X().foo(1); +} + +template void bar ();