From 3697264c3aabddb0d77d3ae3a5a2bd7ccaad1790 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Wed, 20 Nov 2019 22:59:20 +0000 Subject: [PATCH] Add test for PR c++/92443. * g++.dg/cpp0x/constexpr-92443.C: New test. From-SVN: r278534 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/constexpr-92443.C | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/constexpr-92443.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 99949be253c..eb33e63ae76 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-11-20 Marek Polacek + + PR c++/92443 + * g++.dg/cpp0x/constexpr-92443.C: New test. + 2019-11-20 Richard Sandiford PR testsuite/92366 diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-92443.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-92443.C new file mode 100644 index 00000000000..8d03e3ed871 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-92443.C @@ -0,0 +1,12 @@ +// PR c++/92443 +// { dg-do compile { target c++11 } } + +struct a { + constexpr a(long) : b() {} + operator long() const; + operator bool(); + constexpr friend a operator|(a, a c) { return c; } + long b; +}; +using d = a; +constexpr d e = 6, f = f | e; -- 2.30.2