]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
This commit was manufactured by cvs2svn to create branch
authorNo Author <no-author@gcc.gnu.org>
Fri, 18 Oct 2002 08:17:57 +0000 (08:17 +0000)
committerNo Author <no-author@gcc.gnu.org>
Fri, 18 Oct 2002 08:17:57 +0000 (08:17 +0000)
'gcc-3_2-branch'.

From-SVN: r58280

gcc/testsuite/g++.dg/overload/member2.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/overload/member2.C b/gcc/testsuite/g++.dg/overload/member2.C
new file mode 100644 (file)
index 0000000..b891414
--- /dev/null
@@ -0,0 +1,41 @@
+// { dg-do run }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 17 Oct 2002 <nathan@codesourcery.com>
+
+// PR 7676. We didn't notice template members were different.
+
+struct foo
+{
+  template<class T>
+  int bar() {return 1;}
+  
+  template<int I>
+  int bar() {return 2;}
+    
+};
+
+struct baz : foo
+{
+  using foo::bar;
+  template<int I>
+  int bar () {return 3;}
+};
+
+int main ()
+{
+  baz b;
+  foo f;
+
+  if (f.bar<1> () != 2)
+    return 1;
+  if (f.bar<int> () != 1)
+    return 2;
+  
+  if (b.bar<1> () != 3)
+    return 1;
+  if (b.bar<int> () != 1)
+    return 2;
+
+  return 0;
+}