* g++.dg/ext/oper1.C: New test.
authorDavid Billinghurst <David.Billinghurst@riotinto.com>
Mon, 20 May 2002 10:33:31 +0000 (10:33 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Mon, 20 May 2002 10:33:31 +0000 (10:33 +0000)
From-SVN: r53657

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/oper1.C [new file with mode: 0644]

index 811e1c41c892ded195590bf6d65da90a0c5b8243..435c71339c13e3cd1363440fcb6d7317bc5be4ef 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-19  Jason Merrill  <jason2redhat.com>
+
+       * g++.dg/ext/oper1.C: New test.
+
+2002-05-20  David Billinghurst <David.Billinghurst@riotinto.com>
 2002-05-19  Mark Mitchell  <mitchell@doubledemon.codesourcery.com>
 
        * README.QMTEST: New file.
diff --git a/gcc/testsuite/g++.dg/ext/oper1.C b/gcc/testsuite/g++.dg/ext/oper1.C
new file mode 100644 (file)
index 0000000..7f97d73
--- /dev/null
@@ -0,0 +1,19 @@
+// { dg-do run }
+
+// Copyright 2002 Free Software Foundation
+// Contributed by Jason Merrill <jason@redhat.com>
+
+// Make sure the GNU extension of accepting dropping cv-qualifiers for
+// the implicit this argument does not kick in when taking the address
+// of an object, since this extension would change the meaning of a
+// well-defined program.
+
+struct A {
+  A* operator&() { return 0; }
+};
+
+int main ()
+{
+  const A a = {};
+  return (&a == 0);
+}