@@ -14240,6 +14294,114 @@ StmtResult Sema::ActOnCXXForRangeIdentifier(Scope *S,
SourceLocation IdentLoc,
: IdentLoc);
}
+static ImplicitConversionKind getConversionKind(QualType FromType,
+
@@ -0,0 +1,86 @@
+// RUN: %clang_cc1 -std=c2x -verify -triple x86_64 -pedantic -Wno-conversion
-Wno-constant-conversion %s
+
+/* WG14 N3018: Full
+ * The constexpr specifier for object definitions
+ */
+
+#define ULLONG_MAX (__LONG_LONG_MAX__*2ULL+1ULL)
+#define UINT_MAX (__INT_
@@ -2932,6 +2932,22 @@ def warn_private_extern : Warning<
def note_private_extern : Note<
"use __attribute__((visibility(\"hidden\"))) attribute instead">;
+// C23 constexpr
+def err_c23_thread_local_constexpr : Error<
+ "thread-local storage is not allowed with constexpr">
@@ -8857,7 +8894,9 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) {
if (NewVD->isConstexpr() && !T->isDependentType() &&
RequireLiteralType(NewVD->getLocation(), T,
- diag::err_constexpr_var_non_literal)) {
+
@@ -14240,6 +14294,114 @@ StmtResult Sema::ActOnCXXForRangeIdentifier(Scope *S,
SourceLocation IdentLoc,
: IdentLoc);
}
+static ImplicitConversionKind getConversionKind(QualType FromType,
+
https://github.com/Fznamznon updated
https://github.com/llvm/llvm-project/pull/73099
>From 1d70b7726e7d1f11622a6d5c8246b0737e024c8d Mon Sep 17 00:00:00 2001
From: "Podchishchaeva, Mariya"
Date: Tue, 19 Sep 2023 08:37:18 -0700
Subject: [PATCH 1/6] [C23] Implement N3018: The constexpr specifier f
@@ -2485,12 +2485,12 @@ bool VarDecl::mightBeUsableInConstantExpressions(const
ASTContext &C) const {
// In C++, const, non-volatile variables of integral or enumeration types
// can be used in constant expressions.
- if (getType()->isIntegralOrEnumerationType())
+ if (
https://github.com/Fznamznon updated
https://github.com/llvm/llvm-project/pull/73099
>From 1d70b7726e7d1f11622a6d5c8246b0737e024c8d Mon Sep 17 00:00:00 2001
From: "Podchishchaeva, Mariya"
Date: Tue, 19 Sep 2023 08:37:18 -0700
Subject: [PATCH 1/6] [C23] Implement N3018: The constexpr specifier f
@@ -482,8 +481,23 @@ ParsedType Sema::getTypeName(const IdentifierInfo &II,
SourceLocation NameLoc,
}
}
}
-// If typo correction failed or was not performed, fall through
-[[fallthrough]];
+Result.suppressDiagnostics();
+return nullptr;
+ cas
https://github.com/Fznamznon created
https://github.com/llvm/llvm-project/pull/73928
Initialize field so there is no use-of-uninitialized-value warning.
>From dd3eb69268bffb92a9deaf93513c0871d8c39b72 Mon Sep 17 00:00:00 2001
From: "Podchishchaeva, Mariya"
Date: Thu, 30 Nov 2023 04:09:33 -0800
Fznamznon wrote:
Fix for buildbot https://github.com/llvm/llvm-project/pull/73928
I'm not able to verify locally though
https://github.com/llvm/llvm-project/pull/73018
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-b
https://github.com/Fznamznon closed
https://github.com/llvm/llvm-project/pull/73928
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -14240,6 +14294,114 @@ StmtResult Sema::ActOnCXXForRangeIdentifier(Scope *S,
SourceLocation IdentLoc,
: IdentLoc);
}
+static ImplicitConversionKind getConversionKind(QualType FromType,
+
@@ -14240,6 +14294,114 @@ StmtResult Sema::ActOnCXXForRangeIdentifier(Scope *S,
SourceLocation IdentLoc,
: IdentLoc);
}
+static ImplicitConversionKind getConversionKind(QualType FromType,
+
Fznamznon wrote:
I'm not sure I understand why gcc is giving an error in
https://godbolt.org/z/qGfnzhfsK. It doesn't give an error with `typename`
keyword and I think there shouldn't be any difference since `Y::E` refers to
current instantiation and is being used by class member declaration s
https://github.com/Fznamznon updated
https://github.com/llvm/llvm-project/pull/73099
>From 1d70b7726e7d1f11622a6d5c8246b0737e024c8d Mon Sep 17 00:00:00 2001
From: "Podchishchaeva, Mariya"
Date: Tue, 19 Sep 2023 08:37:18 -0700
Subject: [PATCH 1/7] [C23] Implement N3018: The constexpr specifier f
@@ -14240,6 +14294,114 @@ StmtResult Sema::ActOnCXXForRangeIdentifier(Scope *S,
SourceLocation IdentLoc,
: IdentLoc);
}
+static ImplicitConversionKind getConversionKind(QualType FromType,
+
https://github.com/Fznamznon created
https://github.com/llvm/llvm-project/pull/74335
Current context set to where alias was met, not where it is declared caused
incorrect access check in case alias referenced private members of the parent
class.
Fixes https://github.com/llvm/llvm-project/issu
https://github.com/Fznamznon updated
https://github.com/llvm/llvm-project/pull/74335
>From 6d7fe6fe8c62373fdaab597c3c31c7132e475e32 Mon Sep 17 00:00:00 2001
From: "Podchishchaeva, Mariya"
Date: Mon, 4 Dec 2023 07:47:04 -0800
Subject: [PATCH 1/2] [clang] Substitute alias templates from correct c
https://github.com/Fznamznon updated
https://github.com/llvm/llvm-project/pull/75456
>From 0e190f131862dd8f4b07891c3ee712a0a163f936 Mon Sep 17 00:00:00 2001
From: "Podchishchaeva, Mariya"
Date: Thu, 14 Dec 2023 01:33:17 -0800
Subject: [PATCH] [clang] Accept recursive non-dependent calls to func
Fznamznon wrote:
Thanks @erichkeane for review!
@zygoloid , I would really appreciate if you took a look as well. Otherwise
I'll try to merge in a couple of days.
https://github.com/llvm/llvm-project/pull/75456
___
cfe-commits mailing list
cfe-commits
https://github.com/Fznamznon updated
https://github.com/llvm/llvm-project/pull/75456
>From 0e190f131862dd8f4b07891c3ee712a0a163f936 Mon Sep 17 00:00:00 2001
From: "Podchishchaeva, Mariya"
Date: Thu, 14 Dec 2023 01:33:17 -0800
Subject: [PATCH 1/2] [clang] Accept recursive non-dependent calls to
@@ -640,3 +640,36 @@ namespace PR46637 {
template struct Y { T x; };
Y auto> y; // expected-error {{'auto' not allowed in template
argument}}
}
+
+namespace GH71015 {
+
+// Check that there is no error in case a templated function is recursive and
+// has a placeholder ret
https://github.com/Fznamznon updated
https://github.com/llvm/llvm-project/pull/75456
>From 0e190f131862dd8f4b07891c3ee712a0a163f936 Mon Sep 17 00:00:00 2001
From: "Podchishchaeva, Mariya"
Date: Thu, 14 Dec 2023 01:33:17 -0800
Subject: [PATCH 1/2] [clang] Accept recursive non-dependent calls to
https://github.com/Fznamznon closed
https://github.com/llvm/llvm-project/pull/75456
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Fznamznon approved this pull request.
Thank you very much for the fix.
I apologize for the trouble.
https://github.com/llvm/llvm-project/pull/77288
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-
https://github.com/Fznamznon created
https://github.com/llvm/llvm-project/pull/77753
Per https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2448r2.html
function/constructor/destructor can be marked `constexpr` even though it never
produces a constant expression.
Non-literal types as ret
@@ -153,16 +153,16 @@ namespace dr1460 { // dr1460: 3.5
namespace Defaulted {
union A { constexpr A() = default; };
union B { int n; constexpr B() = default; };
-// cxx11-17-error@-1 {{defaulted definition of default constructor is not
constexpr}}
+// cxx11-1
@@ -423,13 +423,13 @@ namespace dr1359 { // dr1359: 3.5
#if __cplusplus >= 201103L
union A { constexpr A() = default; };
union B { constexpr B() = default; int a; }; // #dr1359-B
- // cxx11-17-error@-1 {{defaulted definition of default constructor is not
constexpr}}
+ //
Fznamznon wrote:
> It looks like Clang even has a warning for this specific case and GCC
> considers it shadowing too: https://godbolt.org/z/Y16njoPxh, which makes me
> think that people want this - at least as a separate flag.
I already came across `-Wshadow-uncaptured-local` flag earlier -
Author: Mariya Podchishchaeva
Date: 2022-02-07T11:57:30+03:00
New Revision: 1cee9608982a866688434223bee44c878ea489b1
URL:
https://github.com/llvm/llvm-project/commit/1cee9608982a866688434223bee44c878ea489b1
DIFF:
https://github.com/llvm/llvm-project/commit/1cee9608982a866688434223bee44c878ea489
Fznamznon wrote:
> I looked at this a bit and the change that increases the constexpr
> restrictions is that ext_defaulted_comparison_constexpr_mismatch (which was
> added in https://reviews.llvm.org/D146090) became
> err_incorrect_defaulted_comparison_constexpr?
Yes, it was intentional chang
@@ -873,9 +873,14 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) {
if (D->isPureVirtual())
Out << " = 0";
- else if (D->isDeletedAsWritten())
+ else if (D->isDeletedAsWritten()) {
Out << " = delete";
- else if (D->isExplicitlyDefaulted())
+if (const
@@ -1936,6 +1936,9 @@ void TextNodeDumper::VisitFunctionDecl(const FunctionDecl
*D) {
if (D->isTrivial())
OS << " trivial";
+ if (const auto *M = D->getDeletedMessage())
Fznamznon wrote:
Here too.
```suggestion
if (const StringLiteral *M = D->getDe
Fznamznon wrote:
@cor3ntin , perhaps a dumb question, but
https://github.com/llvm/llvm-project/pull/77753 should only help in post C++20
modes since only there destructor can be `constexpr`. How about older versions?
Clang will still emit an error that the type from
https://github.com/llvm/ll
https://github.com/Fznamznon created
https://github.com/llvm/llvm-project/pull/80975
As it was pointed out in https://github.com/llvm/llvm-project/pull/80724, we
should not be checking `getLangOpts().Bool` when determining something related
to logical operators, since it only indicates that bo
Fznamznon wrote:
Not sure about what to put in a release note, and whether it is necessary at
all.
https://github.com/llvm/llvm-project/pull/80975
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/
Fznamznon wrote:
> CI on Windows seems to have had a stroke?
Yes it does have troubles ATM. We rely on Linux CI for now until Windows is
fixed. Some context on the future may be found in
https://discourse.llvm.org/t/rfc-future-of-windows-pre-commit-ci/76840/1 .
https://github.com/llvm/llvm-pr
@@ -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
@@ -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 f
@@ -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 initialize
@@ -2393,6 +2393,25 @@ static bool CheckConstexprFunctionBody(Sema &SemaRef,
const FunctionDecl *Dcl,
Kind))
return false;
}
+} else if (!Constructor->isDelegatingConstructor()) {
+ for (const Decl *decl :
@@ -2393,6 +2393,25 @@ static bool CheckConstexprFunctionBody(Sema &SemaRef,
const FunctionDecl *Dcl,
Kind))
return false;
}
+} else if (!Constructor->isDelegatingConstructor()) {
+ for (const Decl *decl :
Fznamznon wrote:
@svenvh , I wonder if you could provide some feedback for OpenCL bits here?
https://github.com/llvm/llvm-project/pull/80975
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com
Fznamznon wrote:
Ping!
https://github.com/llvm/llvm-project/pull/74512
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Fznamznon wrote:
Ping.
https://github.com/llvm/llvm-project/pull/73099
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Fznamznon wrote:
> The side-effect on OpenCL looks good to me; thanks!
Thanks!
https://github.com/llvm/llvm-project/pull/80975
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Fznamznon closed
https://github.com/llvm/llvm-project/pull/80975
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Fznamznon edited
https://github.com/llvm/llvm-project/pull/81225
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Fznamznon commented:
I don't have anything to add, except release notes nits, but I'd like to
someone else to take a look. cc @shafik @cor3ntin @AaronBallman
My question about why can't we do the same as non-template version does remains
unanswered.
https://github.com/llvm/
@@ -149,9 +149,10 @@ Improvements to Clang's diagnostics
prints.
- 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 use of th
@@ -149,9 +149,10 @@ Improvements to Clang's diagnostics
prints.
- Clang now diagnoses member template declarations with multiple declarators.
+- Clang now diagnoses use of the ``template`` keyword after declarative nested
name specifiers.
Fznamznon wrote:
Fznamznon wrote:
> @Fznamznon in non-template version `else if
> (!Constructor->isDependentContext()
> &&!Constructor->isDelegatingConstructor())` this is the check that is
> performed and `isDependentContext` is true for templates, so I have separate
> condition for template versions. I'm do
https://github.com/Fznamznon updated
https://github.com/llvm/llvm-project/pull/74512
>From 169d962b64b8ae242c3a6d332677296cf7503839 Mon Sep 17 00:00:00 2001
From: "Podchishchaeva, Mariya"
Date: Tue, 5 Dec 2023 10:28:44 -0800
Subject: [PATCH 1/5] [clang] Avoid -Wshadow warning when init-capture
Fznamznon wrote:
> And I'm not sure that it STOPS being confusing because of the lack of a
> capture of 'this'.
For that reason, I didn't fully disable the warning, and put it under
`-Wshadow-uncaptured-local` flag instead.
https://github.com/llvm/llvm-project/pull/74512
_
@@ -8400,19 +8412,28 @@ void Sema::CheckShadow(NamedDecl *D, NamedDecl
*ShadowedDecl,
/// when these variables are captured by the lambda.
void Sema::DiagnoseShadowingLambdaDecls(const LambdaScopeInfo *LSI) {
for (const auto &Shadow : LSI->ShadowingDecls) {
-const VarDec
@@ -179,3 +179,64 @@ void f() {
#endif
}
}
+
+namespace GH71976 {
+#ifdef AVOID
+struct A {
+ int b = 5;
+ int foo() {
+return [b = b]() { return b; }(); // no -Wshadow diagnostic, init-capture
does not shadow b due to not capturing this
+ }
+};
+
+struct B {
+ int a;
@@ -8328,35 +8328,47 @@ void Sema::CheckShadow(NamedDecl *D, NamedDecl
*ShadowedDecl,
unsigned WarningDiag = diag::warn_decl_shadow;
SourceLocation CaptureLoc;
- if (isa(D) && isa(ShadowedDecl) && NewDC &&
- isa(NewDC)) {
+ if (isa(D) && NewDC && isa(NewDC)) {
@@ -8328,35 +8328,47 @@ void Sema::CheckShadow(NamedDecl *D, NamedDecl
*ShadowedDecl,
unsigned WarningDiag = diag::warn_decl_shadow;
SourceLocation CaptureLoc;
- if (isa(D) && isa(ShadowedDecl) && NewDC &&
- isa(NewDC)) {
+ if (isa(D) && NewDC && isa(NewDC)) {
https://github.com/Fznamznon updated
https://github.com/llvm/llvm-project/pull/74512
>From 169d962b64b8ae242c3a6d332677296cf7503839 Mon Sep 17 00:00:00 2001
From: "Podchishchaeva, Mariya"
Date: Tue, 5 Dec 2023 10:28:44 -0800
Subject: [PATCH 1/6] [clang] Avoid -Wshadow warning when init-capture
@@ -8328,35 +8328,47 @@ void Sema::CheckShadow(NamedDecl *D, NamedDecl
*ShadowedDecl,
unsigned WarningDiag = diag::warn_decl_shadow;
SourceLocation CaptureLoc;
- if (isa(D) && isa(ShadowedDecl) && NewDC &&
- isa(NewDC)) {
+ if (isa(D) && NewDC && isa(NewDC)) {
https://github.com/Fznamznon closed
https://github.com/llvm/llvm-project/pull/74512
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Fznamznon wrote:
Okay then, could you please review or give me an LGTM if everything is ok? The
patch transformed a bit since it was first approved. It doesn't enable feature
as extension now, it incorporates changes and test highlighted by
https://github.com/llvm/llvm-project/pull/77753#issue
https://github.com/Fznamznon closed
https://github.com/llvm/llvm-project/pull/73099
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2809,10 +2813,13 @@ def note_non_literal_virtual_base :
Note<"%select{struct|interface|class}0 "
"with virtual base %plural{1:class|:classes}1 is not a literal type">;
def note_constexpr_virtual_base_here : Note<"virtual base class declared
here">;
def err_constexpr_non
@@ -2774,9 +2774,13 @@ def err_constexpr_tag : Error<
def err_constexpr_dtor : Error<
"destructor cannot be declared %sub{select_constexpr_spec_kind}0">;
def err_constexpr_dtor_subobject : Error<
- "destructor cannot be declared %sub{select_constexpr_spec_kind}0 because "
+
@@ -2809,10 +2813,13 @@ def note_non_literal_virtual_base :
Note<"%select{struct|interface|class}0 "
"with virtual base %plural{1:class|:classes}1 is not a literal type">;
def note_constexpr_virtual_base_here : Note<"virtual base class declared
here">;
def err_constexpr_non
@@ -2809,10 +2813,13 @@ def note_non_literal_virtual_base :
Note<"%select{struct|interface|class}0 "
"with virtual base %plural{1:class|:classes}1 is not a literal type">;
def note_constexpr_virtual_base_here : Note<"virtual base class declared
here">;
def err_constexpr_non
@@ -2809,10 +2813,13 @@ def note_non_literal_virtual_base :
Note<"%select{struct|interface|class}0 "
"with virtual base %plural{1:class|:classes}1 is not a literal type">;
def note_constexpr_virtual_base_here : Note<"virtual base class declared
here">;
def err_constexpr_non
https://github.com/Fznamznon closed
https://github.com/llvm/llvm-project/pull/77753
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Fznamznon created
https://github.com/llvm/llvm-project/pull/84343
Fixes https://github.com/llvm/llvm-project/issues/83267
>From 9c2fccb61a058385171415f863eaccb666e7b120 Mon Sep 17 00:00:00 2001
From: "Podchishchaeva, Mariya"
Date: Thu, 7 Mar 2024 08:56:35 -0800
Subject: [PAT
https://github.com/Fznamznon closed
https://github.com/llvm/llvm-project/pull/84343
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Fznamznon wrote:
> Can we please get more descriptive summaries in the future.
Sure, sorry about that.
https://github.com/llvm/llvm-project/pull/84343
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listi
Fznamznon wrote:
> to fail, which I think is not intentional?
No, it is not. Fails only for c++23 now. I'm looking.
https://github.com/llvm/llvm-project/pull/77753
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin
Fznamznon wrote:
Ok, now I looked at it a bit more, and I think this is expected due to the
change and how clang behaved before this patch. After this patch implicit
destructor of S, i.e. `~S` becomes `constexpr`. It used to be not `constexpr`
because neither `P` nor `B` had `constexpr` destru
@@ -14277,6 +14325,113 @@ StmtResult Sema::ActOnCXXForRangeIdentifier(Scope *S,
SourceLocation IdentLoc,
: IdentLoc);
}
+static ImplicitConversionKind GetConversionKind(QualType FromType,
Fznamznon wrote:
https://github.com/Fznamznon edited
https://github.com/llvm/llvm-project/pull/73099
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Fznamznon edited
https://github.com/llvm/llvm-project/pull/73099
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Fznamznon updated
https://github.com/llvm/llvm-project/pull/73099
>From 1d70b7726e7d1f11622a6d5c8246b0737e024c8d Mon Sep 17 00:00:00 2001
From: "Podchishchaeva, Mariya"
Date: Tue, 19 Sep 2023 08:37:18 -0700
Subject: [PATCH 01/12] [C23] Implement N3018: The constexpr specifier
@@ -1382,6 +1382,20 @@ void DeclSpec::Finish(Sema &S, const PrintingPolicy
&Policy) {
ThreadStorageClassSpec = TSCS_unspecified;
ThreadStorageClassSpecLoc = SourceLocation();
}
+if (S.getLangOpts().C23 &&
+getConstexprSpecifier() == ConstexprSpecKin
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -fsyntax-only -verify=c23 -std=c23 %s -Wpre-c2x-compat
+// RUN: %clang_cc1 -fsyntax-only -verify=c17 -std=c17 %s
+
+
Fznamznon wrote:
Added test cases.
https://github.com/llvm/llvm-project/pull/73099
__
@@ -0,0 +1,296 @@
+// RUN: %clang_cc1 -std=c2x -verify -triple x86_64 -pedantic -Wno-conversion
-Wno-constant-conversion -Wno-div-by-zero %s
+
+// Check that constexpr only applies to variables.
+constexpr void f0() {} // expected-error {{'constexpr' can only be used in
variable
@@ -0,0 +1,296 @@
+// RUN: %clang_cc1 -std=c2x -verify -triple x86_64 -pedantic -Wno-conversion
-Wno-constant-conversion -Wno-div-by-zero %s
+
+// Check that constexpr only applies to variables.
+constexpr void f0() {} // expected-error {{'constexpr' can only be used in
variable
https://github.com/Fznamznon edited
https://github.com/llvm/llvm-project/pull/73099
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,296 @@
+// RUN: %clang_cc1 -std=c2x -verify -triple x86_64 -pedantic -Wno-conversion
-Wno-constant-conversion -Wno-div-by-zero %s
+
+// Check that constexpr only applies to variables.
+constexpr void f0() {} // expected-error {{'constexpr' can only be used in
variable
@@ -0,0 +1,296 @@
+// RUN: %clang_cc1 -std=c2x -verify -triple x86_64 -pedantic -Wno-conversion
-Wno-constant-conversion -Wno-div-by-zero %s
+
+// Check that constexpr only applies to variables.
+constexpr void f0() {} // expected-error {{'constexpr' can only be used in
variable
@@ -8569,6 +8571,37 @@ static bool checkForConflictWithNonVisibleExternC(Sema
&S, const T *ND,
return false;
}
+static bool CheckC23ConstexprVarType(Sema &SemaRef, SourceLocation VarLoc,
+ QualType T) {
+
+ if (T->isVariableArrayType())
https://github.com/Fznamznon edited
https://github.com/llvm/llvm-project/pull/73099
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -8569,6 +8571,37 @@ static bool checkForConflictWithNonVisibleExternC(Sema
&S, const T *ND,
return false;
}
+static bool CheckC23ConstexprVarType(Sema &SemaRef, SourceLocation VarLoc,
+ QualType T) {
+
+ if (T->isVariableArrayType())
@@ -5140,6 +5140,8 @@ Decl *Sema::ParsedFreeStandingDeclSpec(Scope *S,
AccessSpecifier AS,
Diag(DS.getConstexprSpecLoc(), diag::err_constexpr_tag)
<< GetDiagnosticTypeSpecifierID(DS)
<< static_cast(DS.getConstexprSpecifier());
+else if (getLangOpt
@@ -13823,7 +13869,9 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr
*Init, bool DirectInit) {
VDecl->setStorageClass(SC_Extern);
// C99 6.7.8p4. All file scoped initializers need to be constant.
-if (!getLangOpts().CPlusPlus && !VDecl->isInvalidDecl())
@@ -8569,6 +8571,37 @@ static bool checkForConflictWithNonVisibleExternC(Sema
&S, const T *ND,
return false;
}
+static bool CheckC23ConstexprVarType(Sema &SemaRef, SourceLocation VarLoc,
+ QualType T) {
+
+ if (T->isVariableArrayType())
@@ -1862,6 +1862,17 @@ class StringLiteral final
llvm_unreachable("Unsupported character width!");
}
+ // Get code unit but preserve sign info.
+ int64_t getCodeUnitS(size_t I, uint64_t BitWidth) const {
Fznamznon wrote:
FYI
https://github.com/llvm/l
https://github.com/Fznamznon updated
https://github.com/llvm/llvm-project/pull/73099
>From 1d70b7726e7d1f11622a6d5c8246b0737e024c8d Mon Sep 17 00:00:00 2001
From: "Podchishchaeva, Mariya"
Date: Tue, 19 Sep 2023 08:37:18 -0700
Subject: [PATCH 01/13] [C23] Implement N3018: The constexpr specifier
@@ -0,0 +1,86 @@
+// RUN: %clang_cc1 -std=c2x -verify -triple x86_64 -pedantic -Wno-conversion
-Wno-constant-conversion %s
Fznamznon wrote:
Done.
https://github.com/llvm/llvm-project/pull/73099
___
cfe-commits mailing
@@ -14277,6 +14325,113 @@ StmtResult Sema::ActOnCXXForRangeIdentifier(Scope *S,
SourceLocation IdentLoc,
: IdentLoc);
}
+static ImplicitConversionKind GetConversionKind(QualType FromType,
Fznamznon wrote:
Fznamznon wrote:
> Please let me know your thoughts.
@AaronBallman , implemented in
https://github.com/llvm/llvm-project/pull/73099/commits/dff61e0f49d0ba0d868f4e9668f75718b031e1e3
.
I was mostly referring to the original page
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3018.htm when im
Fznamznon wrote:
So, I've spent some time on it, and it turns out that because of current design
choices supporting the whole feature in older language modes and not loosing
any warnings/errors happens to be a much more significant change.
For example, due to the fact that constexprness of cons
@@ -9108,7 +9123,8 @@ bool Sema::CheckExplicitlyDefaultedComparison(Scope *S,
FunctionDecl *FD,
// declaration, it is implicitly considered to be constexpr.
// FIXME: Only applying this to the first declaration seems problematic, as
// simple reorderings can affect the
@@ -356,14 +356,7 @@ C++23 implementation status
Relaxing some constexpr restrictions
https://wg21.link/P2448R2";>P2448R2
-
-Clang 17 (Partial)
- We do not support outside of defaulted special memeber functions the
change that constexpr f
101 - 200 of 830 matches
Mail list logo