[clang] [Clang] enhance loop analysis to handle variable changes inside lambdas (PR #135573)

2025-04-18 Thread Oleksandr T. via cfe-commits
@@ -299,3 +299,18 @@ void test10() { for (auto[i, j, k] = arr; i < a; ++i) { } for (auto[i, j, k] = arr; i < a; ++arr[0]) { } }; + +extern void foo(int); a-tarasyuk wrote: @shafik, thanks for the review. I've updated tests https://github.com/llvm/llvm-pro

[clang] [Clang] enhance loop analysis to handle variable changes inside lambdas (PR #135573)

2025-04-18 Thread Oleksandr T. via cfe-commits
a-tarasyuk wrote: @AaronBallman Should this issue ideally be resolved by CFG rather than the current AST matcher fix? https://github.com/llvm/llvm-project/pull/135573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang] [Clang] disallow use of attributes before extern template declarations (PR #136328)

2025-04-18 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/136328 >From 0729ae4d4a971905aefc8f1c1ec2ec81a0f149e9 Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Fri, 18 Apr 2025 20:09:56 +0300 Subject: [PATCH 1/2] [Clang] disallow use of attributes before extern tem

[clang] [Clang] diagnose deleted/default redeclaration of defined friend functions (PR #136717)

2025-04-22 Thread Oleksandr T. via cfe-commits
@@ -142,6 +142,13 @@ NamedDecl *Parser::ParseCXXInlineMethodDef( SkipUntil(tok::semi); } +Decl *PrevDecl = FnD->getPreviousDecl(); +if (PrevDecl && isa(PrevDecl) && a-tarasyuk wrote: @zwuis thanks https://github.com/llvm/llvm-project/pull/

[clang] [Clang] diagnose deleted/default redeclaration of defined friend functions (PR #136717)

2025-04-22 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/136717 >From cca0eacad86036539b41971794cc2ee0d1e2d577 Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Tue, 22 Apr 2025 18:35:46 +0300 Subject: [PATCH 1/2] [Clang] diagnose deleted/defaulted redeclaration of

[clang] [Clang] raise extension warning for unknown namespaced attributes (PR #120925)

2025-04-28 Thread Oleksandr T. via cfe-commits
a-tarasyuk wrote: @erichkeane @AaronBallman @cor3ntin, just checking if there are any updates on this, as the `Clang 20` release was landed. https://github.com/llvm/llvm-project/pull/120925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[clang] [Clang] diagnose deleted/default redeclaration of defined friend functions (PR #136717)

2025-04-24 Thread Oleksandr T. via cfe-commits
@@ -142,6 +142,14 @@ NamedDecl *Parser::ParseCXXInlineMethodDef( SkipUntil(tok::semi); } +if (FunctionDecl *FD = +dyn_cast_if_present(FnD->getPreviousDecl())) { + if (isa(FD->getLexicalDeclContext()) || + Actions.getDefaultedFunctionKind

[clang] [Clang] diagnose deleted/default redeclaration of defined friend functions (PR #136717)

2025-04-24 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk closed https://github.com/llvm/llvm-project/pull/136717 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] diagnose deleted/default redeclaration of defined friend functions (PR #136717)

2025-04-24 Thread Oleksandr T. via cfe-commits
@@ -142,6 +142,14 @@ NamedDecl *Parser::ParseCXXInlineMethodDef( SkipUntil(tok::semi); } +if (FunctionDecl *FD = +dyn_cast_if_present(FnD->getPreviousDecl())) { + if (isa(FD->getLexicalDeclContext()) || + Actions.getDefaultedFunctionKind

[clang] [Clang] enhance loop analysis to handle variable changes inside lambdas (PR #135573)

2025-04-13 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/135573 >From 05125bafc45755624973feba0f4e6c2050fad36f Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Mon, 14 Apr 2025 01:37:05 +0300 Subject: [PATCH] [Clang] enhance loop analysis to handle variable changes

[clang] [Clang] enhance loop analysis to handle variable changes inside lambdas (PR #135573)

2025-04-13 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk created https://github.com/llvm/llvm-project/pull/135573 Fixes #132038 --- This PR extends `-Wloop-analysis` to handle variable modifications inside lambda expressions. >From 05125bafc45755624973feba0f4e6c2050fad36f Mon Sep 17 00:00:00 2001 From: Oleksandr Ta

[clang] [Clang] enhance loop analysis to handle variable changes inside lambdas (PR #135573)

2025-04-14 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/135573 >From fd46c6b9af7193376f294a3adae47d579de8503b Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Mon, 14 Apr 2025 14:05:25 +0300 Subject: [PATCH] [Clang] enhance loop analysis to handle variable changes

[clang] [Clang] enhance loop analysis to handle variable changes inside lambdas (PR #135573)

2025-04-16 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/135573 >From f3a021b0acbb028b647e5fab02ff053ad88b Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Wed, 16 Apr 2025 01:08:55 +0300 Subject: [PATCH] [Clang] enhance loop analysis to handle variable changes

[clang] [Clang] enhance loop analysis to handle variable changes inside lambdas (PR #135573)

2025-04-16 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/135573 >From 6a4bfc48c306928cc0fb516cd340e06fa83d54e8 Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Wed, 16 Apr 2025 15:57:00 +0300 Subject: [PATCH] [Clang] enhance loop analysis to handle variable changes

[clang] [clang][test] Improve unit tests for Fixed point AST matchers. (PR #134398)

2025-04-14 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk approved this pull request. https://github.com/llvm/llvm-project/pull/134398 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] enhance loop analysis to handle variable changes inside lambdas (PR #135573)

2025-04-14 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/135573 >From 05125bafc45755624973feba0f4e6c2050fad36f Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Mon, 14 Apr 2025 01:37:05 +0300 Subject: [PATCH] [Clang] enhance loop analysis to handle variable changes

[clang] [Clang] enhance loop analysis to handle variable changes inside lambdas (PR #135573)

2025-04-16 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/135573 >From 27e98b9fbfb808ab19cf688d48d688801d9647c1 Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Thu, 17 Apr 2025 00:40:34 +0300 Subject: [PATCH] [Clang] enhance loop analysis to handle variable changes

[clang] [Clang] raise extension warning for unknown namespaced attributes (PR #120925)

2025-05-04 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk edited https://github.com/llvm/llvm-project/pull/120925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] diagnose unknown attribute namespaces (PR #138519)

2025-05-05 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/138519 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,san

[clang] [Clang] diagnose unknown attribute namespaces (PR #138519)

2025-05-05 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk edited https://github.com/llvm/llvm-project/pull/138519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] diagnose unknown attribute namespaces (PR #138519)

2025-05-05 Thread Oleksandr T. via cfe-commits
@@ -385,6 +385,8 @@ related warnings within the method body. - Clang now disallows the use of attributes applied before an ``extern template`` declaration (#GH79893). +- Clang now diagnoses unknown attribute namespaces a-tarasyuk wrote: @erichkeane I’ve upd

[clang] [Clang] diagnose unknown attribute namespaces (PR #138519)

2025-05-05 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk created https://github.com/llvm/llvm-project/pull/138519 This patch enhances Clang's attribute handling by diagnosing unknown attribute namespaces ```c++ [[foo::nodiscard]] int f(); // warning: unknown attribute namespace 'unknown'; attribute 'unknown::foo' igno

[clang] [Clang] diagnose unknown attribute namespaces (PR #138519)

2025-05-05 Thread Oleksandr T. via cfe-commits
@@ -6861,13 +6861,19 @@ ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, const ParsedAttr &AL, // though they were unknown attributes. if (AL.getKind() == ParsedAttr::UnknownAttribute || !AL.existsInTarget(S.Context.getTargetInfo())) { -S.Diag(AL.getLoc(), -

[clang] [Clang] diagnose unknown attribute namespaces (PR #138519)

2025-05-05 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/138519 >From 7d376b33f09801be504ec65a2853679dff8b726c Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Mon, 5 May 2025 15:30:14 +0300 Subject: [PATCH 1/3] [Clang] diagnose unknown attribute namespaces --- c

[clang] [Clang] diagnose unknown attribute namespaces (PR #138519)

2025-05-06 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/138519 >From 7d376b33f09801be504ec65a2853679dff8b726c Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Mon, 5 May 2025 15:30:14 +0300 Subject: [PATCH 1/3] [Clang] diagnose unknown attribute namespaces --- c

[clang] [Clang] diagnose deleted/default redeclaration of defined friend functions (PR #136717)

2025-04-24 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk edited https://github.com/llvm/llvm-project/pull/136717 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] diagnose deleted/default redeclaration of defined friend functions (PR #136717)

2025-04-22 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/136717 >From cca0eacad86036539b41971794cc2ee0d1e2d577 Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Tue, 22 Apr 2025 18:35:46 +0300 Subject: [PATCH 1/3] [Clang] diagnose deleted/defaulted redeclaration of

[clang] [Clang] diagnose deleted/default redeclaration of defined friend functions (PR #136717)

2025-04-22 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/136717 >From cca0eacad86036539b41971794cc2ee0d1e2d577 Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Tue, 22 Apr 2025 18:35:46 +0300 Subject: [PATCH 1/3] [Clang] diagnose deleted/defaulted redeclaration of

[clang] [Clang] add ext warning for missing return in 'main' for C89 mode (PR #134617)

2025-04-10 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/134617 >From 64210203803f7ba9deec06d467ee570bff761108 Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Sun, 6 Apr 2025 00:17:38 +0300 Subject: [PATCH 1/4] [Clang] add ext warning for missing return in 'main'

[clang] [Clang] enhance loop analysis to handle variable changes inside lambdas (PR #135573)

2025-04-15 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/135573 >From ab01bebfa99f635d80c234e19bf3aa73977ce149 Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Wed, 16 Apr 2025 01:08:55 +0300 Subject: [PATCH] [Clang] enhance loop analysis to handle variable changes

[clang] [Clang] raise extension warning for unknown namespaced attributes (PR #120925)

2025-05-03 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/120925 >From c1aa5c649c052c230cc76d073186ad8fdd14723f Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Sun, 4 May 2025 02:13:29 +0300 Subject: [PATCH] [Clang] raise extension warning for unknown namespaced a

[clang] [Clang] raise extension warning for unknown namespaced attributes (PR #120925)

2025-05-03 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/120925 >From 9bb85586f40f659a8bff414511bed9592083efbd Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Sun, 4 May 2025 01:13:20 +0300 Subject: [PATCH] [Clang] raise extension warning for unknown namespaced a

[clang] [Clang] raise extension warning for unknown namespaced attributes (PR #120925)

2025-05-03 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/120925 >From 9bb85586f40f659a8bff414511bed9592083efbd Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Sun, 4 May 2025 01:13:20 +0300 Subject: [PATCH 1/2] [Clang] raise extension warning for unknown namespace

[clang] [Clang] raise extension warning for unknown namespaced attributes (PR #120925)

2025-05-03 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk edited https://github.com/llvm/llvm-project/pull/120925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] disallow use of attributes before extern template declarations (PR #136328)

2025-04-18 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk created https://github.com/llvm/llvm-project/pull/136328 Fixes #79893 --- This PR addresses the issue of _attributes_ being incorrectly allowed on `extern template` declarations ```cpp [[deprecated]] extern template struct S; ``` >From 0729ae4d4a971905aefc

[clang] [Clang] enhance loop analysis to handle variable changes inside lambdas (PR #135573)

2025-04-18 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/135573 >From 93c8fc7faba6ab9537039b8745e62f5d79785cd0 Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Thu, 17 Apr 2025 23:58:35 +0300 Subject: [PATCH] [Clang] enhance loop analysis to handle variable changes

[clang] [Clang] disallow use of attributes before extern template declarations (PR #136328)

2025-04-21 Thread Oleksandr T. via cfe-commits
@@ -1049,6 +1049,7 @@ Parser::ParseExternalDeclaration(ParsedAttributes &Attrs, case tok::kw_extern: if (getLangOpts().CPlusPlus && NextToken().is(tok::kw_template)) { + ProhibitAttributes(Attrs); a-tarasyuk wrote: @AaronBallman @erichkeane thanks

[clang] [Clang] disallow use of attributes before extern template declarations (PR #136328)

2025-04-21 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk edited https://github.com/llvm/llvm-project/pull/136328 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] disallow use of attributes before extern template declarations (PR #136328)

2025-04-21 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk closed https://github.com/llvm/llvm-project/pull/136328 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] disallow use of attributes before extern template declarations (PR #136328)

2025-04-21 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk deleted https://github.com/llvm/llvm-project/pull/136328 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] enhance loop analysis to handle variable changes inside lambdas (PR #135573)

2025-04-21 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/135573 >From 93c8fc7faba6ab9537039b8745e62f5d79785cd0 Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Thu, 17 Apr 2025 23:58:35 +0300 Subject: [PATCH 1/2] [Clang] enhance loop analysis to handle variable cha

[clang] [Clang] diagnose unknown attribute namespaces (PR #138519)

2025-05-07 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/138519 >From cbbca4d26b8d00eb103f110c2341fab2e4a2e40d Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Mon, 5 May 2025 15:30:14 +0300 Subject: [PATCH 1/2] [Clang] diagnose unknown attribute namespaces --- c

[clang] [Clang] show attribute namespace in diagnostics (PR #138519)

2025-05-07 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk edited https://github.com/llvm/llvm-project/pull/138519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] add -Wshift-bool warning to handle shifting of bool (PR #127336)

2025-02-18 Thread Oleksandr T. via cfe-commits
@@ -7115,6 +7115,9 @@ def warn_shift_result_sets_sign_bit : Warning< "signed shift result (%0) sets the sign bit of the shift expression's " "type (%1) and becomes negative">, InGroup>, DefaultIgnore; +def warn_shift_bool : Warning< + "%select{left|right}0 shifting a `bo

[clang] [Clang] emit -Wunused-variable warning for unused structured bindings without the [[maybe_unused]] attribute (PR #127061)

2025-02-18 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/127061 >From a76ee008bdb87655da465e21d09c840edecc2b1b Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Thu, 13 Feb 2025 15:24:09 +0200 Subject: [PATCH 1/2] [Clang] emit -Wunused-variable warning for unused structur

[clang] [Clang] add -Wshift-bool warning to handle shifting of bool (PR #127336)

2025-02-18 Thread Oleksandr T. via cfe-commits
@@ -11246,6 +11246,12 @@ static void DiagnoseBadShiftValues(Sema& S, ExprResult &LHS, ExprResult &RHS, if (S.getLangOpts().OpenCL) return; + if (LHS.get()->IgnoreParenImpCasts()->getType()->isBooleanType()) { +S.Diag(Loc, diag::warn_shift_bool) +<< (Opc ==

[clang] [Clang] add -Wshift-bool warning to handle shifting of bool (PR #127336)

2025-02-18 Thread Oleksandr T. via cfe-commits
@@ -11246,6 +11246,12 @@ static void DiagnoseBadShiftValues(Sema& S, ExprResult &LHS, ExprResult &RHS, if (S.getLangOpts().OpenCL) return; + if (LHS.get()->IgnoreParenImpCasts()->getType()->isBooleanType()) { +S.Diag(Loc, diag::warn_shift_bool) +<< (Opc ==

[clang] [Clang] add additional tests for -Wshift-bool (PR #130339)

2025-03-07 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk created https://github.com/llvm/llvm-project/pull/130339 Fixes https://github.com/llvm/llvm-project/pull/127336#pullrequestreview-2665950553 >From bed2cb009ae2e560aa00f86b90c57d82f97bb435 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Fri, 7 Mar 2025 22:10:24 +

[clang] [Clang] use constant evaluation context for constexpr if conditions (PR #123667)

2025-03-07 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/123667 >From 00b8b64879ad3ae35a0a671da563ac876ffaf228 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Mon, 20 Jan 2025 22:51:00 +0200 Subject: [PATCH 1/5] [Clang] use constant evaluation context for constexpr if c

[clang] [Clang] add -Wshift-bool warning to handle shifting of bool (PR #127336)

2025-03-07 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk closed https://github.com/llvm/llvm-project/pull/127336 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] emit -Wunused-variable warning for unused structured bindings without the [[maybe_unused]] attribute (PR #127061)

2025-03-07 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/127061 >From a76ee008bdb87655da465e21d09c840edecc2b1b Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Thu, 13 Feb 2025 15:24:09 +0200 Subject: [PATCH 1/2] [Clang] emit -Wunused-variable warning for unused structur

[clang] [Clang] use constant evaluation context for constexpr if conditions (PR #123667)

2025-03-09 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/123667 >From 00b8b64879ad3ae35a0a671da563ac876ffaf228 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Mon, 20 Jan 2025 22:51:00 +0200 Subject: [PATCH 1/6] [Clang] use constant evaluation context for constexpr if c

[clang] [Clang] use constant evaluation context for constexpr if conditions (PR #123667)

2025-03-09 Thread Oleksandr T. via cfe-commits
@@ -309,6 +309,7 @@ Bug Fixes to AST Handling ^ - Fixed type checking when a statement expression ends in an l-value of atomic type. (#GH106576) - Fixed uninitialized use check in a lambda within CXXOperatorCallExpr. (#GH129198) +- Clang now correctly

[clang] [Clang] use constant evaluation context for constexpr if conditions (PR #123667)

2025-03-09 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/123667 >From 00b8b64879ad3ae35a0a671da563ac876ffaf228 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Mon, 20 Jan 2025 22:51:00 +0200 Subject: [PATCH 1/7] [Clang] use constant evaluation context for constexpr if c

[clang] [Clang] use constant evaluation context for constexpr if conditions (PR #123667)

2025-03-06 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk deleted https://github.com/llvm/llvm-project/pull/123667 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] use parameter location for abbreviated function templates (PR #129139)

2025-03-06 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk closed https://github.com/llvm/llvm-project/pull/129139 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] add -Wshift-bool warning to handle shifting of bool (PR #127336)

2025-03-06 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/127336 >From 272385df25b791b50472b92e12157477d021a26f Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sat, 15 Feb 2025 18:19:44 +0200 Subject: [PATCH 1/8] [Clang] add -Wshift-bool warning to handle shifting of boo

[clang] [Clang] use constant evaluation context for constexpr if conditions (PR #123667)

2025-03-09 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk closed https://github.com/llvm/llvm-project/pull/123667 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] emit -Wunused-variable warning for unused structured bindings without the [[maybe_unused]] attribute (PR #127061)

2025-03-11 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/127061 >From a76ee008bdb87655da465e21d09c840edecc2b1b Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Thu, 13 Feb 2025 15:24:09 +0200 Subject: [PATCH 1/2] [Clang] emit -Wunused-variable warning for unused structur

[clang] [Clang] add additional tests for -Wshift-bool (PR #130339)

2025-03-11 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/130339 >From bed2cb009ae2e560aa00f86b90c57d82f97bb435 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Fri, 7 Mar 2025 22:10:24 +0200 Subject: [PATCH 1/2] [Clang] add additional tests for -Wshift-bool --- clang/te

[clang] [Clang] add additional tests for -Wshift-bool (PR #130339)

2025-03-11 Thread Oleksandr T. via cfe-commits
@@ -22,4 +23,6 @@ void t() { if ((y << 1) != 0) { } if ((y >> 1) != 0) { } // expected-warning {{right shifting a 'bool' implicitly converts it to 'int'}} + + bool k = (x < z) >> 1; // expected-warning {{right shifting a 'bool' implicitly converts it to 'int'}}

[clang] [Clang] use constant evaluation context for constexpr if conditions (PR #123667)

2025-03-11 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/123667 >From 00b8b64879ad3ae35a0a671da563ac876ffaf228 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Mon, 20 Jan 2025 22:51:00 +0200 Subject: [PATCH 1/7] [Clang] use constant evaluation context for constexpr if c

[clang] [Clang] emit -Wunused-variable warning for unused structured bindings without the [[maybe_unused]] attribute (PR #127061)

2025-03-11 Thread Oleksandr T. via cfe-commits
@@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++2c -Wunused %s + +namespace GH125810 { +struct S { + int a, b; +}; + +void t(S s) { + auto &[_, _] = s; + auto &[a1, _] = s; // expected-warning {{unused variable '[a1, _]'}} a-tarasyuk wrote:

[clang] [Clang] add additional tests for -Wshift-bool (PR #130339)

2025-03-11 Thread Oleksandr T. via cfe-commits
@@ -0,0 +1,24 @@ +// RUN: %clang_cc1 -fsyntax-only -Wshift-bool -verify %s + +void t() { + int x = 10; + int y = 1; + + int a = y << x; + int b = y >> x; + + int c = 0 << x; + int d = 0 >> x; + + int e = y << 1; + int f = y >> 1; + + int g = y << -1; // expected-warning {

[clang] [Clang] use constant evaluation context for constexpr if conditions (PR #123667)

2025-03-11 Thread Oleksandr T. via cfe-commits
@@ -2203,8 +2203,18 @@ Parser::ParseCXXCondition(StmtResult *InitStmt, SourceLocation Loc, return ParseCXXCondition(nullptr, Loc, CK, MissingOK); } -// Parse the expression. -ExprResult Expr = ParseExpression(); // expression +ExprResult Expr; +{ +

[clang] [Clang] use parameter location for abbreviated function templates (PR #129139)

2025-02-27 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk created https://github.com/llvm/llvm-project/pull/129139 Fixes #46386 --- When an abbreviated function template appears in an `extern "C"` block and all template parameters are invented, `TemplateParams->getTemplateLoc()` becomes invalid, leading to an incorrec

[clang] [Clang] add additional tests for -Wshift-bool (PR #130339)

2025-03-11 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/130339 >From bed2cb009ae2e560aa00f86b90c57d82f97bb435 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Fri, 7 Mar 2025 22:10:24 +0200 Subject: [PATCH 1/4] [Clang] add additional tests for -Wshift-bool --- clang/te

[clang] [Clang] emit -Wunused-variable warning for unused structured bindings without the [[maybe_unused]] attribute (PR #127061)

2025-03-13 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/127061 >From a76ee008bdb87655da465e21d09c840edecc2b1b Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Thu, 13 Feb 2025 15:24:09 +0200 Subject: [PATCH 1/2] [Clang] emit -Wunused-variable warning for unused structur

[clang] [Clang] emit -Wunused-variable warning for unused structured bindings without the [[maybe_unused]] attribute (PR #127061)

2025-03-12 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk deleted https://github.com/llvm/llvm-project/pull/127061 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] emit -Wunused-variable warning for unused structured bindings without the [[maybe_unused]] attribute (PR #127061)

2025-03-12 Thread Oleksandr T. via cfe-commits
@@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++2c -Wunused %s + +namespace GH125810 { +struct S { + int a, b; +}; + +void t(S s) { + auto &[_, _] = s; + auto &[a1, _] = s; // expected-warning {{unused variable '[a1, _]'}} a-tarasyuk wrote:

[clang] [Clang] use parameter location for abbreviated function templates (PR #129139)

2025-03-05 Thread Oleksandr T. via cfe-commits
@@ -7991,8 +7991,12 @@ Sema::CheckTemplateDeclScope(Scope *S, TemplateParameterList *TemplateParams) { // have C linkage. DeclContext *Ctx = S->getEntity(); if (Ctx && Ctx->isExternCContext()) { -Diag(TemplateParams->getTemplateLoc(), diag::err_template_linkage) -

[clang] [Clang] add -Wshift-bool warning to handle shifting of bool (PR #127336)

2025-03-05 Thread Oleksandr T. via cfe-commits
@@ -11246,6 +11246,12 @@ static void DiagnoseBadShiftValues(Sema& S, ExprResult &LHS, ExprResult &RHS, if (S.getLangOpts().OpenCL) return; + if (LHS.get()->IgnoreParenImpCasts()->getType()->isBooleanType()) { +S.Diag(Loc, diag::warn_shift_bool) +<< (Opc ==

[clang] [Clang] use constant evaluation context for constexpr if conditions (PR #123667)

2025-03-05 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/123667 >From 00b8b64879ad3ae35a0a671da563ac876ffaf228 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Mon, 20 Jan 2025 22:51:00 +0200 Subject: [PATCH 1/5] [Clang] use constant evaluation context for constexpr if c

[clang] [Clang] use parameter location for abbreviated function templates (PR #129139)

2025-03-05 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/129139 >From 4ae7fe210d36daa111ba78d1cc26785d805148b6 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Fri, 28 Feb 2025 00:41:43 +0200 Subject: [PATCH 1/2] [Clang] use parameter location for abbreviated function te

[clang] [Clang] use parameter location for abbreviated function templates (PR #129139)

2025-03-05 Thread Oleksandr T. via cfe-commits
@@ -7991,8 +7991,12 @@ Sema::CheckTemplateDeclScope(Scope *S, TemplateParameterList *TemplateParams) { // have C linkage. DeclContext *Ctx = S->getEntity(); if (Ctx && Ctx->isExternCContext()) { -Diag(TemplateParams->getTemplateLoc(), diag::err_template_linkage) -

[clang] [Clang] use parameter location for abbreviated function templates (PR #129139)

2025-03-05 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk edited https://github.com/llvm/llvm-project/pull/129139 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] add -Wshift-bool warning to handle shifting of bool (PR #127336)

2025-03-05 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/127336 >From 272385df25b791b50472b92e12157477d021a26f Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sat, 15 Feb 2025 18:19:44 +0200 Subject: [PATCH 1/8] [Clang] add -Wshift-bool warning to handle shifting of boo

[clang] [Clang] add -Wshift-bool warning to handle shifting of bool (PR #127336)

2025-03-05 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk deleted https://github.com/llvm/llvm-project/pull/127336 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] add -Wshift-bool warning to handle shifting of bool (PR #127336)

2025-03-05 Thread Oleksandr T. via cfe-commits
@@ -11247,6 +11247,12 @@ static void DiagnoseBadShiftValues(Sema& S, ExprResult &LHS, ExprResult &RHS, if (S.getLangOpts().OpenCL) return; + if (Opc == BO_Shr && + LHS.get()->IgnoreParenImpCasts()->getType()->isBooleanType()) { +S.Diag(Loc, diag::warn_shift_bo

[clang] [Clang] add additional tests for -Wshift-bool (PR #130339)

2025-03-12 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/130339 >From bed2cb009ae2e560aa00f86b90c57d82f97bb435 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Fri, 7 Mar 2025 22:10:24 +0200 Subject: [PATCH 1/4] [Clang] add additional tests for -Wshift-bool --- clang/te

[clang] [Clang] emit -Wunused-variable warning for unused structured bindings without the [[maybe_unused]] attribute (PR #127061)

2025-03-12 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/127061 >From a76ee008bdb87655da465e21d09c840edecc2b1b Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Thu, 13 Feb 2025 15:24:09 +0200 Subject: [PATCH 1/2] [Clang] emit -Wunused-variable warning for unused structur

[clang] [Clang] add additional tests for -Wshift-bool (PR #130339)

2025-03-12 Thread Oleksandr T. via cfe-commits
@@ -0,0 +1,24 @@ +// RUN: %clang_cc1 -fsyntax-only -Wshift-bool -verify %s + +void t() { + int x = 10; + int y = 1; + + int a = y << x; + int b = y >> x; + + int c = 0 << x; + int d = 0 >> x; + + int e = y << 1; + int f = y >> 1; + + int g = y << -1; // expected-warning {

[clang] [Clang] allow restrict qualifier for array types with pointer types as element types (PR #120896)

2025-02-14 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/120896 >From 295df258043ef5a87ae603eedd308b863bad7b59 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sun, 22 Dec 2024 15:14:30 +0200 Subject: [PATCH 01/13] [Clang] allow restrict qualifier for array types with po

[clang] [Clang] emit -Wunused-variable warning for unused structured bindings without the [[maybe_unused]] attribute (PR #127061)

2025-02-14 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/127061 >From a76ee008bdb87655da465e21d09c840edecc2b1b Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Thu, 13 Feb 2025 15:24:09 +0200 Subject: [PATCH 1/2] [Clang] emit -Wunused-variable warning for unused structur

[clang] [Clang] emit -Wunused-variable warning for unused structured bindings without the [[maybe_unused]] attribute (PR #127061)

2025-02-14 Thread Oleksandr T. via cfe-commits
@@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++2c -Wunused %s a-tarasyuk wrote: @Fznamznon I've updated. thanks https://github.com/llvm/llvm-project/pull/127061 ___ cfe-commits mailing list cfe-comm

[clang] [Clang] allow restrict qualifier for array types with pointer types as element types (PR #120896)

2025-02-14 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk closed https://github.com/llvm/llvm-project/pull/120896 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] emit -Wunused-variable warning for unused structured bindings without the [[maybe_unused]] attribute (PR #127061)

2025-02-14 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/127061 >From a76ee008bdb87655da465e21d09c840edecc2b1b Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Thu, 13 Feb 2025 15:24:09 +0200 Subject: [PATCH 1/2] [Clang] emit -Wunused-variable warning for unused structur

[clang] [Clang] use constant evaluation context for constexpr if conditions (PR #123667)

2025-02-19 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk edited https://github.com/llvm/llvm-project/pull/123667 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] add -Wshift-bool warning to handle shifting of bool (PR #127336)

2025-02-19 Thread Oleksandr T. via cfe-commits
@@ -11246,6 +11246,12 @@ static void DiagnoseBadShiftValues(Sema& S, ExprResult &LHS, ExprResult &RHS, if (S.getLangOpts().OpenCL) return; + if (LHS.get()->IgnoreParenImpCasts()->getType()->isBooleanType()) { +S.Diag(Loc, diag::warn_shift_bool) +<< (Opc ==

[clang] [Clang] emit -Wunused-variable warning for unused structured bindings without the [[maybe_unused]] attribute (PR #127061)

2025-02-20 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/127061 >From a76ee008bdb87655da465e21d09c840edecc2b1b Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Thu, 13 Feb 2025 15:24:09 +0200 Subject: [PATCH 1/2] [Clang] emit -Wunused-variable warning for unused structur

[clang] [Clang] add -Wshift-bool warning to handle shifting of bool (PR #127336)

2025-02-21 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/127336 >From 272385df25b791b50472b92e12157477d021a26f Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sat, 15 Feb 2025 18:19:44 +0200 Subject: [PATCH 1/6] [Clang] add -Wshift-bool warning to handle shifting of boo

[clang] [Clang] add -Wshift-bool warning to handle shifting of bool (PR #127336)

2025-02-21 Thread Oleksandr T. via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -fsyntax-only -Wshift-bool -verify %s + +void t() { + int x = 10; + bool y = true; + + bool a = y >> x; // expected-warning {{right shifting a `bool` implicitly converts it to 'int'}} + bool b = false >> x; // expected-warning {{right

[clang] [Clang] add -Wshift-bool warning to handle shifting of bool (PR #127336)

2025-02-21 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/127336 >From 272385df25b791b50472b92e12157477d021a26f Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sat, 15 Feb 2025 18:19:44 +0200 Subject: [PATCH 1/6] [Clang] add -Wshift-bool warning to handle shifting of boo

[clang] [HLSL] add parentheses in assertion to eliminate -Wparentheses warning (PR #128246)

2025-02-21 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk created https://github.com/llvm/llvm-project/pull/128246 Fixes #128210 >From 55a38b8d5c8864557f20f642a7202c6242aa3b83 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sat, 22 Feb 2025 01:01:41 +0200 Subject: [PATCH] [HLSL] add parentheses in assertion to eliminat

[clang] [HLSL] add parentheses in assertion to eliminate -Wparentheses warning (PR #128246)

2025-02-21 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk closed https://github.com/llvm/llvm-project/pull/128246 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] add -Wshift-bool warning to handle shifting of bool (PR #127336)

2025-02-20 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/127336 >From 272385df25b791b50472b92e12157477d021a26f Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sat, 15 Feb 2025 18:19:44 +0200 Subject: [PATCH 1/4] [Clang] add -Wshift-bool warning to handle shifting of boo

[clang] [Clang] add -Wshift-bool warning to handle shifting of bool (PR #127336)

2025-02-20 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/127336 >From 272385df25b791b50472b92e12157477d021a26f Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sat, 15 Feb 2025 18:19:44 +0200 Subject: [PATCH 1/5] [Clang] add -Wshift-bool warning to handle shifting of boo

[clang] [Clang] add -Wshift-bool warning to handle shifting of bool (PR #127336)

2025-02-20 Thread Oleksandr T. via cfe-commits
@@ -11246,6 +11246,12 @@ static void DiagnoseBadShiftValues(Sema& S, ExprResult &LHS, ExprResult &RHS, if (S.getLangOpts().OpenCL) return; + if (LHS.get()->IgnoreParenImpCasts()->getType()->isBooleanType()) { +S.Diag(Loc, diag::warn_shift_bool) +<< (Opc ==

[clang] [Clang] add -Wshift-bool warning to handle shifting of bool (PR #127336)

2025-02-20 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk edited https://github.com/llvm/llvm-project/pull/127336 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] add -Wshift-bool warning to handle shifting of bool (PR #127336)

2025-02-20 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/127336 >From 272385df25b791b50472b92e12157477d021a26f Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sat, 15 Feb 2025 18:19:44 +0200 Subject: [PATCH 1/5] [Clang] add -Wshift-bool warning to handle shifting of boo

<    5   6   7   8   9   10   11   >