From 10d8c51f302ae1899d7fe9e4d48edb2cfb294ad9 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Mon, 18 Sep 2017 12:08:14 +0000 Subject: [PATCH] re PR c++/45033 ("delete" does overload resolution for class operands, but shouldn't.) 2017-09-18 Paolo Carlini PR c++/45033 * g++.dg/expr/delete1.C: New. From-SVN: r252924 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/expr/delete1.C | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 gcc/testsuite/g++.dg/expr/delete1.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a84419551de..f2ad8a052ee 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-09-18 Paolo Carlini + + PR c++/45033 + * g++.dg/expr/delete1.C: New. + 2017-09-18 Bob Duff * gnat.dg/validity_check.adb: New testcase. diff --git a/gcc/testsuite/g++.dg/expr/delete1.C b/gcc/testsuite/g++.dg/expr/delete1.C new file mode 100644 index 00000000000..902e0cc4f01 --- /dev/null +++ b/gcc/testsuite/g++.dg/expr/delete1.C @@ -0,0 +1,12 @@ +// PR c++/45033 + +struct A { + operator int*() { return 0; } + operator int*() const { return 0; } +}; + +int main() { + A a; + int *p = a; + delete a; +} -- 2.30.2