This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Testcase for fixed PR c++/2437


Applied.

	* g++.dg/lookup/two-stage1.C: New test.

Index: g++.dg/lookup/two-stage1.C
===================================================================
RCS file: g++.dg/lookup/two-stage1.C
diff -N g++.dg/lookup/two-stage1.C
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ g++.dg/lookup/two-stage1.C	3 Jan 2003 02:10:03 -0000
@@ -0,0 +1,18 @@
+/* PR c++/2437 */
+/* { dg-do run } */
+
+// Test of two-stage name lookup.
+
+int g(double) { return 0; }
+ 
+template <class T> struct X
+{
+  int f() { return g(2); } // should call g(double)
+};
+ 
+inline int g(int) { return 1; }
+ 
+int main()
+{
+  return X<int>().f(); // should call g(double), but used to call g(int)
+}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]