Skip to content

[clang-tidy] support ak_attr_info in diagnostic forwarding #147503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 8, 2025

Conversation

a-tarasyuk
Copy link
Member

This patch addresses missing support for forwarding ak_attr_info diagnostic arguments in ClangTidyDiagnosticConsumer

@llvmbot
Copy link
Member

llvmbot commented Jul 8, 2025

@llvm/pr-subscribers-clang-tools-extra

Author: Oleksandr T. (a-tarasyuk)

Changes

This patch addresses missing support for forwarding ak_attr_info diagnostic arguments in ClangTidyDiagnosticConsumer


Full diff: https://github.com/llvm/llvm-project/pull/147503.diff

1 Files Affected:

  • (modified) clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp (+3)
diff --git a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
index c35f0b941c600..f9d75978d0ea8 100644
--- a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
+++ b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
@@ -544,6 +544,9 @@ void ClangTidyDiagnosticConsumer::forwardDiagnostic(const Diagnostic &Info) {
     case clang::DiagnosticsEngine::ak_attr:
       Builder << reinterpret_cast<Attr *>(Info.getRawArg(Index));
       break;
+    case clang::DiagnosticsEngine::ak_attr_info:
+      Builder << reinterpret_cast<AttributeCommonInfo *>(Info.getRawArg(Index));
+      break;
     case clang::DiagnosticsEngine::ak_addrspace:
       Builder << static_cast<LangAS>(Info.getRawArg(Index));
       break;

@llvmbot
Copy link
Member

llvmbot commented Jul 8, 2025

@llvm/pr-subscribers-clang-tidy

Author: Oleksandr T. (a-tarasyuk)

Changes

This patch addresses missing support for forwarding ak_attr_info diagnostic arguments in ClangTidyDiagnosticConsumer


Full diff: https://github.com/llvm/llvm-project/pull/147503.diff

1 Files Affected:

  • (modified) clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp (+3)
diff --git a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
index c35f0b941c600..f9d75978d0ea8 100644
--- a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
+++ b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
@@ -544,6 +544,9 @@ void ClangTidyDiagnosticConsumer::forwardDiagnostic(const Diagnostic &Info) {
     case clang::DiagnosticsEngine::ak_attr:
       Builder << reinterpret_cast<Attr *>(Info.getRawArg(Index));
       break;
+    case clang::DiagnosticsEngine::ak_attr_info:
+      Builder << reinterpret_cast<AttributeCommonInfo *>(Info.getRawArg(Index));
+      break;
     case clang::DiagnosticsEngine::ak_addrspace:
       Builder << static_cast<LangAS>(Info.getRawArg(Index));
       break;

@a-tarasyuk a-tarasyuk requested a review from AaronBallman July 8, 2025 11:02
@mikaelholmen
Copy link
Collaborator

This solves the compilation warning/error I reported in
#144619 (comment)

Copy link
Collaborator

@mikaelholmen mikaelholmen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM since it solves the warning/error.

@vbvictor
Copy link
Contributor

vbvictor commented Jul 8, 2025

Did any of the builders caught this, or it is some local configuration?
Asking just in case if we should create one for catching such CE's.

@mikaelholmen
Copy link
Collaborator

Did any of the builders caught this, or it is some local configuration? Asking just in case if we should create one for catching such CE's.

I saw it locally when compiling with -Wall -Werror. I don't know if any builder use -Werror? I don't see any sign of it in #144619 at least.

Copy link
Collaborator

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@a-tarasyuk a-tarasyuk merged commit 0ff01ef into llvm:main Jul 8, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants