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

2025-05-28 Thread Erich Keane 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 Erich Keane 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 Erich Keane via cfe-commits
https://github.com/erichkeane 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-28 Thread Erich Keane 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 Erich Keane via cfe-commits
https://github.com/erichkeane commented: I'm really in favor of this direction, this is great, thank you! I have a few suggestions here (and if there is good reason, feel free to ignore the ones re return-type & setting invalid in particular), but this is pretty good for me. https://github.co

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

2025-05-27 Thread Aaron Ballman 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
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-27 Thread Aaron Ballman 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-27 Thread Aaron Ballman 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-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 Yanzuo Liu via cfe-commits
zwuis wrote: Can you handle this case `[[using gnu : deprected]]`? 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-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 fix-it hints for unknown attributes (PR #141305)

2025-05-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Oleksandr T. (a-tarasyuk) Changes This patch adds fix-it hints for unknown attribute names when Clang suggests a correction --- Full diff: https://github.com/llvm/llvm-project/pull/141305.diff 3 Files Affected: - (modified) clang/docs/