summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/lookup/scope-operator1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/lookup/scope-operator1.C')
-rw-r--r--gcc/testsuite/g++.dg/lookup/scope-operator1.C20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/lookup/scope-operator1.C b/gcc/testsuite/g++.dg/lookup/scope-operator1.C
new file mode 100644
index 000000000..fde36f01e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/scope-operator1.C
@@ -0,0 +1,20 @@
+/* PR c++/250 */
+/* { dg-do compile } */
+
+template <class T> void Bar(T *p)
+{
+}
+
+template <class T> class Foo
+{
+public:
+ Foo(T *p) { Bar(p); }
+ // The global scope operator wasn't respected in this case under gcc 3.0
+ void Bar(T *p) { ::Bar<T>(p); }
+};
+
+int main()
+{
+ double* d;
+ Foo<double> f(d);
+}