This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ PATCH: Fix PR c++/9411
- From: Mark Mitchell <mark at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 10 Jul 2003 12:19:44 -0700
- Subject: C++ PATCH: Fix PR c++/9411
- Reply-to: mark at codesourcery dot com
Wolfgang noticed that I'd re-created this defect with by
non-dependent-expressions patch. I've now stomped it again. There
was no test-case for this PR before because it got accidentally fixed
with the new parser, or some such -- now there's a test-case so we
shan't be seeing this particular bug ever again...
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
2003-07-10 Mark Mitchell <mark@codesourcery.com>
PR c++/9411
* parser.c (cp_parser_postfix_expression): Check dependency of
functions.
2003-07-10 Mark Mitchell <mark@codesourcery.com>
PR c++/9411
* g++.dg/template/explicit2.C: New test.
Index: cp/parser.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/parser.c,v
retrieving revision 1.78
diff -c -5 -p -r1.78 parser.c
*** cp/parser.c 9 Jul 2003 23:06:39 -0000 1.78
--- cp/parser.c 10 Jul 2003 19:16:06 -0000
*************** cp_parser_postfix_expression (cp_parser
*** 3844,3853 ****
--- 3844,3854 ----
if (processing_template_decl
&& (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
= build_min_nt (CALL_EXPR, postfix_expression, args);
break;
Index: testsuite/g++.dg/template/explicit2.C
===================================================================
RCS file: testsuite/g++.dg/template/explicit2.C
diff -N testsuite/g++.dg/template/explicit2.C
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- testsuite/g++.dg/template/explicit2.C 10 Jul 2003 19:16:22 -0000
***************
*** 0 ****
--- 1,10 ----
+ struct X {
+ template <class B> void foo(B);
+ };
+
+ template <class D>
+ void bar() {
+ X().foo<D>(1);
+ }
+
+ template void bar<int> ();