]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Fix up g++.dg/reflect/type_trait14.C for -fimplicit-constexpr [PR124844] master trunk
authorJakub Jelinek <jakub@redhat.com>
Fri, 10 Apr 2026 19:52:48 +0000 (21:52 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 10 Apr 2026 19:52:48 +0000 (21:52 +0200)
The g++.dg/reflect/type_trait14.C test FAILs with -fimplicit-constexpr,
because in that case NLType is actually a literal type rather than
non-literal type and so is structural type too.

Fixed by making sure it is not a literal type even with
-fimplicit-constexpr.

2026-04-10  Jakub Jelinek  <jakub@redhat.com>

PR c++/124844
* g++.dg/reflect/type_trait14.C (NLType::~NLType): Move definition out
of the class.

Reviewed-by: Jason Merrill <jason@redhat.com>
gcc/testsuite/g++.dg/reflect/type_trait14.C

index 7aa1d5f1dd362a0c9a57bd1ee864073fd4515aa4..ff8c2fe81fc656fd58e2773d0cc73b9b6cc08a1c 100644 (file)
@@ -25,8 +25,9 @@ struct NLType {
   NLType () : _M_i(0) { }
   constexpr NLType (int __i) : _M_i(__i) { }
   NLType (const NLType &__other) : _M_i(__other._M_i) { }
-  ~NLType () { _M_i = 0; }
+  ~NLType ();
 };
+NLType::~NLType () { _M_i = 0; }
 
 static_assert (is_structural_type (^^int));
 static_assert (is_structural_type (^^float));