summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-20 10:33:31 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-20 10:33:31 +0000
commitbbc8cca01806989049ae9b8f0e69968af69ebfe0 (patch)
tree81607d7c5b3846ae6a97b42b830023737ac08b58 /gcc
parentf3c9db610db0af5142eb2d4d0e1ebaa75612fb25 (diff)
downloadgcc-bbc8cca01806989049ae9b8f0e69968af69ebfe0.tar.gz
* g++.dg/ext/oper1.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53657 138bc75d-0d04-0410-961f-82ee72b054a4
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 811e1c41c89..435c71339c1 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 00000000000..7f97d73a8f5
--- /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);
+}