@@ -2393,6 +2393,25 @@ static bool CheckConstexprFunctionBody(Sema ,
const FunctionDecl *Dcl,
Kind))
return false;
}
+} else if (!Constructor->isDelegatingConstructor()) {
+ for (const Decl *decl :
@@ -2393,6 +2393,25 @@ static bool CheckConstexprFunctionBody(Sema ,
const FunctionDecl *Dcl,
Kind))
return false;
}
+} else if (!Constructor->isDelegatingConstructor()) {
+ for (const Decl *decl :
@@ -2393,6 +2393,25 @@ static bool CheckConstexprFunctionBody(Sema ,
const FunctionDecl *Dcl,
Kind))
return false;
}
+} else if (!Constructor->isDelegatingConstructor()) {
+ for (const Decl *decl :
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -std=c++14 -verify -fcxx-exceptions
-Werror=c++14-extensions -Werror=c++20-extensions %s
+
+template struct C {
+union {
+ int i;
+};
+constexpr C() {} // expected-error {{constexpr union constructor that does
not
@@ -150,6 +150,8 @@ Improvements to Clang's diagnostics
- Clang now diagnoses member template declarations with multiple declarators.
- Clang now diagnoses use of the ``template`` keyword after declarative nested
name specifiers.
+- Clang now diagnoses constexpr constructor
@@ -224,6 +224,9 @@ struct TemplateInit {
};
// FIXME: This is ill-formed (no diagnostic required). We should diagnose it.
constexpr TemplateInit() {} // desired-error {{must initialize all members}}
Fznamznon wrote:
We've got the desired error, I think
https://github.com/mahtohappy updated
https://github.com/llvm/llvm-project/pull/81042
>From 9271e67ab27f850413e3d6d6f1383454067efe75 Mon Sep 17 00:00:00 2001
From: mahtohappy
Date: Wed, 7 Feb 2024 13:29:45 -0800
Subject: [PATCH 1/2] Diagnosis for constexpr constructor not initializing a
union
https://github.com/mahtohappy updated
https://github.com/llvm/llvm-project/pull/81042
>From 9271e67ab27f850413e3d6d6f1383454067efe75 Mon Sep 17 00:00:00 2001
From: mahtohappy
Date: Wed, 7 Feb 2024 13:29:45 -0800
Subject: [PATCH] Diagnosis for constexpr constructor not initializing a union
@@ -224,6 +224,9 @@ struct TemplateInit {
};
// FIXME: This is ill-formed (no diagnostic required). We should diagnose it.
constexpr TemplateInit() {} // desired-error {{must initialize all members}}
+#ifndef CXX2A
mahtohappy wrote:
yes, I'm here just
@@ -224,6 +224,9 @@ struct TemplateInit {
};
// FIXME: This is ill-formed (no diagnostic required). We should diagnose it.
constexpr TemplateInit() {} // desired-error {{must initialize all members}}
+#ifndef CXX2A
shafik wrote:
We normally do this
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -std=c++14 -verify -fcxx-exceptions
-Werror=c++14-extensions -Werror=c++20-extensions %s
+
+template struct C {
+union {
+ int i;
+};
+constexpr C() {} // expected-error {{constexpr union constructor that does
not
https://github.com/mahtohappy edited
https://github.com/llvm/llvm-project/pull/81042
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/mahtohappy edited
https://github.com/llvm/llvm-project/pull/81042
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
13 matches
Mail list logo