[llvm] [libcxx] [clang-tools-extra] [clang] [lld] [mlir] [libc] [libunwind] [libcxxabi] [openmp] [flang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2023-11-30 Thread Mariya Podchishchaeva via cfe-commits
@@ -14240,6 +14294,114 @@ StmtResult Sema::ActOnCXXForRangeIdentifier(Scope *S, SourceLocation IdentLoc, : IdentLoc); } +static ImplicitConversionKind getConversionKind(QualType FromType, +

[llvm] [libcxx] [clang-tools-extra] [clang] [lld] [mlir] [libc] [libunwind] [libcxxabi] [openmp] [flang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2023-11-30 Thread Mariya Podchishchaeva via cfe-commits
@@ -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_

[clang-tools-extra] [clang] [libcxxabi] [libunwind] [libcxx] [openmp] [libc] [flang] [llvm] [mlir] [lld] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2023-11-30 Thread Mariya Podchishchaeva via cfe-commits
@@ -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">

[clang-tools-extra] [clang] [libcxxabi] [libunwind] [libcxx] [openmp] [libc] [flang] [llvm] [mlir] [lld] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2023-11-30 Thread Mariya Podchishchaeva via cfe-commits
@@ -8857,7 +8894,9 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) { if (NewVD->isConstexpr() && !T->isDependentType() && RequireLiteralType(NewVD->getLocation(), T, - diag::err_constexpr_var_non_literal)) { +

[clang-tools-extra] [clang] [libcxxabi] [libunwind] [libcxx] [openmp] [libc] [flang] [llvm] [mlir] [lld] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2023-11-30 Thread Mariya Podchishchaeva via cfe-commits
@@ -14240,6 +14294,114 @@ StmtResult Sema::ActOnCXXForRangeIdentifier(Scope *S, SourceLocation IdentLoc, : IdentLoc); } +static ImplicitConversionKind getConversionKind(QualType FromType, +

[mlir] [lldb] [lld] [llvm] [flang] [libcxx] [libc] [clang-tools-extra] [compiler-rt] [openmp] [clang] [libcxxabi] [libunwind] [C23] Implement N3018: The constexpr specifier for object definitions (PR

2023-11-30 Thread Mariya Podchishchaeva via 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 1/6] [C23] Implement N3018: The constexpr specifier f

[mlir] [clang] [compiler-rt] [llvm] [lldb] [libcxxabi] [libcxx] [clang-tools-extra] [flang] [lld] [libunwind] [libc] [openmp] [C23] Implement N3018: The constexpr specifier for object definitions (PR

2023-11-30 Thread Mariya Podchishchaeva via cfe-commits
@@ -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 (

[compiler-rt] [libcxx] [libunwind] [clang] [openmp] [llvm] [clang-tools-extra] [libcxxabi] [lld] [flang] [lldb] [mlir] [libc] [C23] Implement N3018: The constexpr specifier for object definitions (PR

2023-11-30 Thread Mariya Podchishchaeva via 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 1/6] [C23] Implement N3018: The constexpr specifier f

[llvm] [clang] [mlir] [compiler-rt] [clang-tools-extra] [clang] Fix a bug with qualified name lookup into current instantiation (PR #73018)

2023-11-30 Thread Mariya Podchishchaeva via cfe-commits
@@ -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

[clang] [clang] Fix sanitizer bot failure after 14ca8d4 (PR #73928)

2023-11-30 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [llvm] [clang-tools-extra] [compiler-rt] [mlir] [clang] Fix a bug with qualified name lookup into current instantiation (PR #73018)

2023-11-30 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [clang] Fix sanitizer bot failure after 14ca8d4 (PR #73928)

2023-11-30 Thread Mariya Podchishchaeva via cfe-commits
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

[compiler-rt] [mlir] [llvm] [lld] [openmp] [lldb] [clang-tools-extra] [libunwind] [flang] [libcxxabi] [clang] [libc] [libcxx] [C23] Implement N3018: The constexpr specifier for object definitions (PR

2023-11-30 Thread Mariya Podchishchaeva via cfe-commits
@@ -14240,6 +14294,114 @@ StmtResult Sema::ActOnCXXForRangeIdentifier(Scope *S, SourceLocation IdentLoc, : IdentLoc); } +static ImplicitConversionKind getConversionKind(QualType FromType, +

[clang-tools-extra] [libunwind] [openmp] [compiler-rt] [flang] [libcxxabi] [lld] [llvm] [mlir] [libc] [libcxx] [lldb] [clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR

2023-11-30 Thread Mariya Podchishchaeva via cfe-commits
@@ -14240,6 +14294,114 @@ StmtResult Sema::ActOnCXXForRangeIdentifier(Scope *S, SourceLocation IdentLoc, : IdentLoc); } +static ImplicitConversionKind getConversionKind(QualType FromType, +

[compiler-rt] [clang] [mlir] [llvm] [clang-tools-extra] [clang] Fix a bug with qualified name lookup into current instantiation (PR #73018)

2023-12-04 Thread Mariya Podchishchaeva via cfe-commits
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

[lldb] [lld] [libc] [compiler-rt] [mlir] [libcxx] [openmp] [llvm] [clang-tools-extra] [libunwind] [flang] [clang] [libcxxabi] [C23] Implement N3018: The constexpr specifier for object definitions (PR

2023-12-04 Thread Mariya Podchishchaeva via 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 1/7] [C23] Implement N3018: The constexpr specifier f

[lldb] [lld] [libc] [compiler-rt] [mlir] [libcxx] [openmp] [llvm] [clang-tools-extra] [libunwind] [flang] [clang] [libcxxabi] [C23] Implement N3018: The constexpr specifier for object definitions (PR

2023-12-04 Thread Mariya Podchishchaeva via cfe-commits
@@ -14240,6 +14294,114 @@ StmtResult Sema::ActOnCXXForRangeIdentifier(Scope *S, SourceLocation IdentLoc, : IdentLoc); } +static ImplicitConversionKind getConversionKind(QualType FromType, +

[clang] [clang] Substitute alias templates from correct context (PR #74335)

2023-12-04 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [clang] Substitute alias templates from correct context (PR #74335)

2023-12-04 Thread Mariya Podchishchaeva via cfe-commits
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

[clang-tools-extra] [clang] [llvm] [clang] Accept recursive non-dependent calls to functions with deduced return type (PR #75456)

2024-01-02 Thread Mariya Podchishchaeva via 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] [clang] Accept recursive non-dependent calls to func

[llvm] [clang-tools-extra] [clang] [clang] Accept recursive non-dependent calls to functions with deduced return type (PR #75456)

2024-01-03 Thread Mariya Podchishchaeva via cfe-commits
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

[clang-tools-extra] [llvm] [clang] [clang] Accept recursive non-dependent calls to functions with deduced return type (PR #75456)

2024-01-04 Thread Mariya Podchishchaeva via 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

[clang-tools-extra] [llvm] [clang] [clang] Accept recursive non-dependent calls to functions with deduced return type (PR #75456)

2024-01-04 Thread Mariya Podchishchaeva via cfe-commits
@@ -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

[libc] [compiler-rt] [clang] [llvm] [clang-tools-extra] [flang] [libcxx] [clang] Accept recursive non-dependent calls to functions with deduced return type (PR #75456)

2024-01-05 Thread Mariya Podchishchaeva via 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

[flang] [llvm] [libcxx] [clang-tools-extra] [libc] [clang] [compiler-rt] [clang] Accept recursive non-dependent calls to functions with deduced return type (PR #75456)

2024-01-05 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [clang] Fix a crash when referencing the result if the overload fails (PR #77288)

2024-01-08 Thread Mariya Podchishchaeva via 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-

[clang] [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (PR #77753)

2024-01-11 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (PR #77753)

2024-01-11 Thread Mariya Podchishchaeva via cfe-commits
@@ -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

[clang] [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (PR #77753)

2024-01-11 Thread Mariya Podchishchaeva via cfe-commits
@@ -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}} + //

[libcxx] [flang] [openmp] [clang-tools-extra] [libcxxabi] [clang] [llvm] [compiler-rt] [libc] [mlir] [clang] Avoid -Wshadow warning when init-capture named same as class field (PR #74512)

2024-01-11 Thread Mariya Podchishchaeva via cfe-commits
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 -

[clang] 1cee960 - [SYCL] Disallow explicit casts between mismatching address spaces

2022-02-07 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (PR #77753)

2024-03-14 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [Clang] [C++26] Implement P2573R2: `= delete("should have a reason");` (PR #86526)

2024-03-26 Thread Mariya Podchishchaeva via cfe-commits
@@ -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

[clang] [Clang] [C++26] Implement P2573R2: `= delete("should have a reason");` (PR #86526)

2024-03-26 Thread Mariya Podchishchaeva via cfe-commits
@@ -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

[clang] [Clang] Implement CWG2598: Union of non-literal types (PR #78195)

2024-02-06 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [clang] Use CPlusPlus language option instead of Bool (PR #80975)

2024-02-07 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [clang] Use CPlusPlus language option instead of Bool (PR #80975)

2024-02-07 Thread Mariya Podchishchaeva via cfe-commits
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/

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-07 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [Clang][Sema] Diagnosis for constexpr constructor not initializing a union member (PR #81042)

2024-02-08 Thread Mariya Podchishchaeva via cfe-commits
@@ -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

[clang] [Clang][Sema] Diagnosis for constexpr constructor not initializing a union member (PR #81042)

2024-02-08 Thread Mariya Podchishchaeva via cfe-commits
@@ -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

[clang] [Clang][Sema] Diagnosis for constexpr constructor not initializing a union member (PR #81042)

2024-02-08 Thread Mariya Podchishchaeva via cfe-commits
@@ -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

[clang] [Clang][Sema] Diagnosis for constexpr constructor not initializing a union member (PR #81042)

2024-02-08 Thread Mariya Podchishchaeva via cfe-commits
@@ -2393,6 +2393,25 @@ static bool CheckConstexprFunctionBody(Sema &SemaRef, const FunctionDecl *Dcl, Kind)) return false; } +} else if (!Constructor->isDelegatingConstructor()) { + for (const Decl *decl :

[clang] [Clang][Sema] Diagnosis for constexpr constructor not initializing a union member (PR #81042)

2024-02-08 Thread Mariya Podchishchaeva via cfe-commits
@@ -2393,6 +2393,25 @@ static bool CheckConstexprFunctionBody(Sema &SemaRef, const FunctionDecl *Dcl, Kind)) return false; } +} else if (!Constructor->isDelegatingConstructor()) { + for (const Decl *decl :

[clang] [clang] Use CPlusPlus language option instead of Bool (PR #80975)

2024-02-08 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [clang] Avoid -Wshadow warning when init-capture named same as class field (PR #74512)

2024-02-08 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-08 Thread Mariya Podchishchaeva via 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

[clang] [clang] Use CPlusPlus language option instead of Bool (PR #80975)

2024-02-08 Thread Mariya Podchishchaeva via 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

[clang] [clang] Use CPlusPlus language option instead of Bool (PR #80975)

2024-02-08 Thread Mariya Podchishchaeva via 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

[clang] [Clang][Sema] Diagnosis for constexpr constructor not initializing a union member (PR #81225)

2024-02-09 Thread Mariya Podchishchaeva via 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

[clang] [Clang][Sema] Diagnosis for constexpr constructor not initializing a union member (PR #81225)

2024-02-09 Thread Mariya Podchishchaeva via 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/

[clang] [Clang][Sema] Diagnosis for constexpr constructor not initializing a union member (PR #81225)

2024-02-09 Thread Mariya Podchishchaeva via cfe-commits
@@ -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

[clang] [Clang][Sema] Diagnosis for constexpr constructor not initializing a union member (PR #81225)

2024-02-09 Thread Mariya Podchishchaeva via cfe-commits
@@ -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:

[clang] [Clang][Sema] Diagnosis for constexpr constructor not initializing a union member (PR #81225)

2024-02-09 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [clang] Avoid -Wshadow warning when init-capture named same as class field (PR #74512)

2024-02-09 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [clang] Avoid -Wshadow warning when init-capture named same as class field (PR #74512)

2024-02-09 Thread Mariya Podchishchaeva via cfe-commits
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 _

[clang] [clang] Avoid -Wshadow warning when init-capture named same as class field (PR #74512)

2024-02-09 Thread Mariya Podchishchaeva via cfe-commits
@@ -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

[clang] [clang] Avoid -Wshadow warning when init-capture named same as class field (PR #74512)

2024-02-09 Thread Mariya Podchishchaeva via cfe-commits
@@ -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;

[clang] [clang] Avoid -Wshadow warning when init-capture named same as class field (PR #74512)

2024-02-09 Thread Mariya Podchishchaeva via cfe-commits
@@ -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)) {

[clang] [clang] Avoid -Wshadow warning when init-capture named same as class field (PR #74512)

2024-02-09 Thread Mariya Podchishchaeva via cfe-commits
@@ -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)) {

[clang] [clang] Avoid -Wshadow warning when init-capture named same as class field (PR #74512)

2024-02-09 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [clang] Avoid -Wshadow warning when init-capture named same as class field (PR #74512)

2024-02-09 Thread Mariya Podchishchaeva via cfe-commits
@@ -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)) {

[clang] [clang] Avoid -Wshadow warning when init-capture named same as class field (PR #74512)

2024-02-12 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (PR #77753)

2024-03-05 Thread Mariya Podchishchaeva via 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

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-03-06 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (PR #77753)

2024-03-06 Thread Mariya Podchishchaeva via 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

[clang] [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (PR #77753)

2024-03-06 Thread Mariya Podchishchaeva via cfe-commits
@@ -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 " +

[clang] [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (PR #77753)

2024-03-06 Thread Mariya Podchishchaeva via 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

[clang] [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (PR #77753)

2024-03-06 Thread Mariya Podchishchaeva via 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

[clang] [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (PR #77753)

2024-03-06 Thread Mariya Podchishchaeva via 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

[clang] [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (PR #77753)

2024-03-07 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [clang] Error on explicit specialization of lambda call operator (PR #84343)

2024-03-07 Thread Mariya Podchishchaeva via 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

[clang] [clang] Error on explicit specialization of lambda call operator (PR #84343)

2024-03-08 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [clang] Error on explicit specialization of lambda call operator (PR #84343)

2024-03-08 Thread Mariya Podchishchaeva via 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

[clang] [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (PR #77753)

2024-03-11 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (PR #77753)

2024-03-11 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-23 Thread Mariya Podchishchaeva via cfe-commits
@@ -14277,6 +14325,113 @@ StmtResult Sema::ActOnCXXForRangeIdentifier(Scope *S, SourceLocation IdentLoc, : IdentLoc); } +static ImplicitConversionKind GetConversionKind(QualType FromType, Fznamznon wrote:

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-23 Thread Mariya Podchishchaeva via 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

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-23 Thread Mariya Podchishchaeva via 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

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-26 Thread Mariya Podchishchaeva via 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

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-26 Thread Mariya Podchishchaeva via cfe-commits
@@ -1382,6 +1382,20 @@ void DeclSpec::Finish(Sema &S, const PrintingPolicy &Policy) { ThreadStorageClassSpec = TSCS_unspecified; ThreadStorageClassSpecLoc = SourceLocation(); } +if (S.getLangOpts().C23 && +getConstexprSpecifier() == ConstexprSpecKin

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-26 Thread Mariya Podchishchaeva via cfe-commits
@@ -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 __

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-26 Thread Mariya Podchishchaeva via 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

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-26 Thread Mariya Podchishchaeva via 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

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-26 Thread Mariya Podchishchaeva via 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

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-26 Thread Mariya Podchishchaeva via 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

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-26 Thread Mariya Podchishchaeva via 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

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-26 Thread Mariya Podchishchaeva via 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())

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-26 Thread Mariya Podchishchaeva via 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

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-26 Thread Mariya Podchishchaeva via 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())

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-26 Thread Mariya Podchishchaeva via cfe-commits
@@ -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

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-26 Thread Mariya Podchishchaeva via cfe-commits
@@ -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())

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-26 Thread Mariya Podchishchaeva via 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())

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-26 Thread Mariya Podchishchaeva via cfe-commits
@@ -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

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-26 Thread Mariya Podchishchaeva via 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/13] [C23] Implement N3018: The constexpr specifier

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-26 Thread Mariya Podchishchaeva via cfe-commits
@@ -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

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-02-26 Thread Mariya Podchishchaeva via cfe-commits
@@ -14277,6 +14325,113 @@ StmtResult Sema::ActOnCXXForRangeIdentifier(Scope *S, SourceLocation IdentLoc, : IdentLoc); } +static ImplicitConversionKind GetConversionKind(QualType FromType, Fznamznon wrote:

[clang] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

2024-03-05 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (PR #77753)

2024-03-05 Thread Mariya Podchishchaeva via cfe-commits
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

[clang] [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (PR #77753)

2024-03-05 Thread Mariya Podchishchaeva via cfe-commits
@@ -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

[clang] [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (PR #77753)

2024-03-05 Thread Mariya Podchishchaeva via cfe-commits
@@ -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

<    1   2   3   4   5   6   7   8   9   >