aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDavid Billinghurst <David.Billinghurst@riotinto.com>2002-05-20 10:33:31 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2002-05-20 10:33:31 +0000
commitb3f47c787cac7a101c40396a7c38faa64ad0bca6 (patch)
tree81607d7c5b3846ae6a97b42b830023737ac08b58 /gcc
parentecc42c14a7b3a9dd4b04c42b49f6da15e9c8cbf1 (diff)
downloadgcc-b3f47c787cac7a101c40396a7c38faa64ad0bca6.zip
gcc-b3f47c787cac7a101c40396a7c38faa64ad0bca6.tar.gz
gcc-b3f47c787cac7a101c40396a7c38faa64ad0bca6.tar.bz2
* g++.dg/ext/oper1.C: New test.
From-SVN: r53657
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/ext/oper1.C19
2 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 811e1c4..435c713 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..7f97d73
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/oper1.C
@@ -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);
+}