re PR c++/9411 ([New parser] Template function lookup problem)
authorMark Mitchell <mark@codesourcery.com>
Thu, 10 Jul 2003 19:19:09 +0000 (19:19 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Thu, 10 Jul 2003 19:19:09 +0000 (19:19 +0000)
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
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/explicit2.C [new file with mode: 0644]

index e91e535c18b164fedfdb8e16a5776f801e398dbe..1d64a22e497aab7421becfbb936c80a384ab63fb 100644 (file)
@@ -1,3 +1,9 @@
+2003-07-10  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/9411
+       * parser.c (cp_parser_postfix_expression): Check dependency of
+       functions.
+
 2003-07-09  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/10032
index 60ec06947557f72341782e07734ce9062e584000..8a76eac0b70f7d5ffb00d93c8f1b20ebe87a4910 100644 (file)
@@ -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
index 100c0edf7c9d21833cfdd023a672a74a444a09c4..363378c033610a3a0cc675d169c670a2de3abb87 100644 (file)
@@ -1,5 +1,8 @@
 2003-07-10  Mark Mitchell  <mark@codesourcery.com>
 
+       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 (file)
index 0000000..79941cd
--- /dev/null
@@ -0,0 +1,10 @@
+struct X {
+  template <class B> void foo(B);
+};
+
+template <class D>
+void bar() {
+  X().foo<D>(1);
+}
+
+template void bar<int> ();