From: Patrick Palka Date: Mon, 1 Feb 2021 13:48:46 +0000 (-0500) Subject: c++: Add testcase for PR84494 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1b303ef6cc8a5913345cbcd91abf13075ab2aec9;p=gcc.git c++: Add testcase for PR84494 We correctly accept this testcase ever since r10-5143. gcc/testsuite/ChangeLog: PR c++/84494 * g++.dg/cpp1y/constexpr-84494.C: New test. --- diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-84494.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-84494.C new file mode 100644 index 00000000000..762cfb4d396 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-84494.C @@ -0,0 +1,11 @@ +// PR c++/84494 +// { dg-do compile { target c++14 } } + +struct X { + constexpr X() = default; + constexpr X(int x) : m_value(x) {} + constexpr X& operator=(const X &o) = default; + int m_value {}; +}; + +static_assert((X() = X(10)).m_value == 10, "");