[clang] [Clang] add fix-it hints for unknown attributes (PR #141305)

2025-05-28 Thread Oleksandr T. via cfe-commits
@@ -7867,15 +7865,16 @@ void Sema::checkUnusedDeclAttributes(Declarator &D) { void Sema::DiagnoseUnknownAttribute(const ParsedAttr &AL) { std::string NormalizedFullName = '\'' + AL.getNormalizedFullName() + '\''; + SourceRange NR = AL.getNormalizedRange();

[clang] [Clang] add fix-it hints for unknown attributes (PR #141305)

2025-05-28 Thread Oleksandr T. via cfe-commits
@@ -7867,15 +7865,16 @@ void Sema::checkUnusedDeclAttributes(Declarator &D) { void Sema::DiagnoseUnknownAttribute(const ParsedAttr &AL) { std::string NormalizedFullName = '\'' + AL.getNormalizedFullName() + '\''; + SourceRange NR = AL.getNormalizedRange();

[clang] [Clang] add fix-it hints for unknown attributes (PR #141305)

2025-05-28 Thread Oleksandr T. via cfe-commits
@@ -1842,8 +1842,7 @@ void Parser::ProhibitCXX11Attributes(ParsedAttributes &Attrs, continue; if (AL.getKind() == ParsedAttr::UnknownAttribute) { if (WarnOnUnknownAttrs) -Diag(AL.getLoc(), diag::warn_unknown_attribute_ignored) -<< AL << AL.g

[clang] [Clang] add fix-it hints for unknown attributes (PR #141305)

2025-05-28 Thread Oleksandr T. via cfe-commits
@@ -672,12 +672,13 @@ static Attr *ProcessStmtAttribute(Sema &S, Stmt *St, const ParsedAttr &A, !(A.existsInTarget(S.Context.getTargetInfo()) || (S.Context.getLangOpts().SYCLIsDevice && Aux && A.existsInTarget(*Aux { -S.Diag(A.getLoc(), A.isRegul

[clang] [Clang] add fix-it hints for unknown attributes (PR #141305)

2025-05-28 Thread Oleksandr T. via cfe-commits
@@ -7867,15 +7865,16 @@ void Sema::checkUnusedDeclAttributes(Declarator &D) { void Sema::DiagnoseUnknownAttribute(const ParsedAttr &AL) { std::string NormalizedFullName = '\'' + AL.getNormalizedFullName() + '\''; + SourceRange NR = AL.getNormalizedRange();

[clang] [Clang] add fix-it hints for unknown attributes (PR #141305)

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

[clang] [Clang] add fix-it hints for unknown attributes (PR #141305)

2025-05-27 Thread Oleksandr T. via cfe-commits
@@ -7867,15 +7867,16 @@ void Sema::checkUnusedDeclAttributes(Declarator &D) { void Sema::DiagnoseUnknownAttribute(const ParsedAttr &AL) { std::string NormalizedFullName = '\'' + AL.getNormalizedFullName() + '\''; + SourceRange NR = AL.getNormalizedRange(); + SourceLocation

[clang] [Clang] add fix-it hints for unknown attributes (PR #141305)

2025-05-27 Thread Oleksandr T. via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang_cc1 -Wunknown-attributes -fsyntax-only -verify %s +// RUN: %clang_cc1 -Wunknown-attributes -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s + +[[gmu::deprected]] // expected-warning {{unknown attribute 'gmu::deprected' ignored;

[clang] [Clang] add fix-it hints for unknown attributes (PR #141305)

2025-05-24 Thread Oleksandr T. via cfe-commits
a-tarasyuk wrote: @zwuis Thanks for the feedback. I've added additional tests to cover this case https://github.com/llvm/llvm-project/pull/141305 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [Clang] add fix-it hints for unknown attributes (PR #141305)

2025-05-24 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/141305 >From 2b84b21462a4e66b8681e165fcd24e3107612448 Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Sat, 24 May 2025 02:52:24 +0300 Subject: [PATCH 1/2] [Clang] add fix-it hints for unknown attributes ---

[clang] [Clang] add fix-it hints for unknown attributes (PR #141305)

2025-05-23 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk created https://github.com/llvm/llvm-project/pull/141305 This patch adds fix-it hints for unknown attribute names when Clang suggests a correction >From 2b84b21462a4e66b8681e165fcd24e3107612448 Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Sat, 24 May 2

[clang] [Clang] add typo correction for unknown attribute names (PR #140629)

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

[clang] [Clang] add typo correction for unknown attribute names (PR #140629)

2025-05-21 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/140629 >From 5b8f0635fdddc87ea326a3b1b47191ab9bf23c0f Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Tue, 20 May 2025 00:38:43 +0300 Subject: [PATCH 1/4] [Clang] add typo correction for unknown attribute na

[clang] [Clang] add typo correction for unknown attribute names (PR #140629)

2025-05-21 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/140629 >From 5b8f0635fdddc87ea326a3b1b47191ab9bf23c0f Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Tue, 20 May 2025 00:38:43 +0300 Subject: [PATCH 1/4] [Clang] add typo correction for unknown attribute na

[clang] [Clang] add typo correction for unknown attribute names (PR #140629)

2025-05-20 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/140629 >From 5b8f0635fdddc87ea326a3b1b47191ab9bf23c0f Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Tue, 20 May 2025 00:38:43 +0300 Subject: [PATCH 1/3] [Clang] add typo correction for unknown attribute na

[clang] [Clang] add typo correction for unknown attribute names (PR #140629)

2025-05-20 Thread Oleksandr T. via cfe-commits
@@ -203,10 +221,47 @@ unsigned AttributeCommonInfo::calculateAttributeSpellingListIndex() const { // attribute spell list index matching code. auto Syntax = static_cast(getSyntax()); StringRef ScopeName = normalizeAttrScopeName(getScopeName(), Syntax); - StringRef Name

[clang] [Clang] add typo correction for unknown attribute names (PR #140629)

2025-05-19 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/140629 >From 5b8f0635fdddc87ea326a3b1b47191ab9bf23c0f Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Tue, 20 May 2025 00:38:43 +0300 Subject: [PATCH 1/2] [Clang] add typo correction for unknown attribute na

[clang] [Clang] add typo correction for unknown attribute names (PR #140629)

2025-05-19 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk created https://github.com/llvm/llvm-project/pull/140629 This patch enhances Clang's diagnosis for unknown attributes by providing typo correction suggestions for known attributes. ```cpp [[gmu::deprected]] // expected-warning {{unknown attribute 'gmu::deprected'

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

2025-05-17 Thread Oleksandr T. via cfe-commits
a-tarasyuk wrote: > I question if -Wloop-analysis should be completely rewritten using dataflow > analysis, rather than AST based matching. should changes inside functions be handled in the following cases? https://github.com/llvm/llvm-project/blob/db0f754c5af8e6c96770533520bf8b17fc0dc977/clan

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

2025-05-08 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk closed 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] show attribute namespace in diagnostics (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] 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] 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] diagnose unknown attribute namespaces (PR #138519)

2025-05-06 Thread Oleksandr T. via cfe-commits
a-tarasyuk wrote: > So I don't believe this is correct either. We want it to always say the > namespace. So clang::unknown will diagnose as unknown attribute > 'clang::unknown' ignored @erichkeane @AaronBallman Thanks for the feedback. I've made changes to include the _scope_ in the diagnost

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

2025-05-06 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk deleted 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-06 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] [Clang] diagnose unknown attribute namespaces --- clang

[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 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-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 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
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 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] 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] 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 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] 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 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-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
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-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] 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] 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] 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] 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] 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] 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
@@ -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-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] disallow use of attributes before extern template declarations (PR #136328)

2025-04-18 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-18 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-18 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: @erichkeane, thanks for the feedb

[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 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] enhance loop analysis to handle variable changes inside lambdas (PR #135573)

2025-04-18 Thread Oleksandr T. via cfe-commits
@@ -299,3 +299,38 @@ void test10() { for (auto[i, j, k] = arr; i < a; ++i) { } for (auto[i, j, k] = arr; i < a; ++arr[0]) { } }; + +namespace GH132038 { +extern void foo(int); +void test1() { + int a = 0; + auto incr_a = [&a]() { ++a; }; + + for (int b = 10; a <= b; incr

[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 1/2] [Clang] enhance loop analysis to handle variable cha

[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] 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] enhance loop analysis to handle variable changes inside lambdas (PR #135573)

2025-04-18 Thread Oleksandr T. via cfe-commits
@@ -299,3 +299,38 @@ void test10() { for (auto[i, j, k] = arr; i < a; ++i) { } for (auto[i, j, k] = arr; i < a; ++arr[0]) { } }; + +namespace GH132038 { +extern void foo(int); +void test1() { + int a = 0; + auto incr_a = [&a]() { ++a; }; + + for (int b = 10; a <= b; incr

[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-17 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/135573 >From b88f9364679db1d85b03f7552f5ed79949b0b775 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] 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] 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] 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] 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-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] 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 30a626ee59fbdf96d055b13fe316ff2a8417c93b Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Tue, 15 Apr 2025 01:07: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-14 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/135573 >From 1bd4c4727596ad6255dd867fd3f2c9386b911bb5 Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Tue, 15 Apr 2025 01:07: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-14 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/135573 >From 213a2377387d8fc032741e4f4ddf50f88fccaca5 Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Tue, 15 Apr 2025 01:07: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-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][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-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-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] 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] 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] [Clang] add ext warning for missing return in 'main' for

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

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

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

2025-04-08 Thread Oleksandr T. via cfe-commits
@@ -1031,6 +1031,8 @@ def err_mainlike_template_decl : Error<"%0 cannot be a template">; def err_main_returns_nonint : Error<"'main' must return 'int'">; def ext_main_returns_nonint : ExtWarn<"return type of 'main' is not 'int'">, InGroup; +def ext_main_no_return : Extensi

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

2025-04-08 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/5] [Clang] add ext warning for missing return in 'main'

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

2025-04-08 Thread Oleksandr T. via cfe-commits
@@ -16232,7 +16232,9 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body, // If the function implicitly returns zero (like 'main') or is naked, // don't complain about missing return statements. - if (FD->hasImplicitReturnZero() || FD->hasAttr()) +

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

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

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

2025-04-07 Thread Oleksandr T. via cfe-commits
@@ -0,0 +1,6 @@ +/* RUN: %clang_cc1 -std=c89 -fsyntax-only -verify -pedantic -Wno-strict-prototypes %s a-tarasyuk wrote: @AaronBallman I've added additonal tests https://github.com/llvm/llvm-project/pull/134617 ___ cf

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

2025-04-07 Thread Oleksandr T. via cfe-commits
@@ -16232,7 +16232,9 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body, // If the function implicitly returns zero (like 'main') or is naked, // don't complain about missing return statements. - if (FD->hasImplicitReturnZero() || FD->hasAttr()) +

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

2025-04-07 Thread Oleksandr T. via cfe-commits
@@ -16232,7 +16232,9 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body, // If the function implicitly returns zero (like 'main') or is naked, // don't complain about missing return statements. - if (FD->hasImplicitReturnZero() || FD->hasAttr()) +

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

2025-04-07 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk created https://github.com/llvm/llvm-project/pull/134617 Fixes #21650 --- Clang currently inserts an implicit `return 0;` in `main()` when compiling in `C89` mode, even though the `C89` standard doesn't require this behavior. This patch changes that behavior b

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

2025-04-05 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-26 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk closed 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-19 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-19 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-19 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-19 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-17 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-17 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] emit -Wunused-variable warning for unused structured bindings without the [[maybe_unused]] attribute (PR #127061)

2025-03-17 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

  1   2   3   4   5   6   7   8   9   10   >