aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/lookup/template1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/lookup/template1.C')
-rw-r--r--gcc/testsuite/g++.dg/lookup/template1.C31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/lookup/template1.C b/gcc/testsuite/g++.dg/lookup/template1.C
new file mode 100644
index 00000000000..0e8921261e8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/template1.C
@@ -0,0 +1,31 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 24 Mar 2003 <nathan@codesourcery.com>
+
+// PR 10199. Lookup problems
+
+class X {
+public:
+ template<int d>
+ int bar ();
+};
+
+template<int x>
+int fooo ();
+
+template<class T>
+void bar (T& g)
+{
+ int kk = fooo<17>(); // OK
+ X x;
+ int k = x.bar<17>(); // Not OK
+}
+
+int main ()
+{
+ X x;
+ int k=x.bar<17>(); // OK
+ int n;
+ bar(n);
+}