-
Notifications
You must be signed in to change notification settings - Fork 14.8k
[clang] Fix crash when diagnosing unsupported attributes #150333
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
Conversation
In llvm#141305, the attribute argument was (unintentionally) removed from the diagnostic emission. Fixes llvm#150237
@llvm/pr-subscribers-clang Author: Benjamin Maxwell (MacDue) ChangesIn #141305, the attribute argument was (unintentionally) removed from the diagnostic emission. Fixes #150237 Full diff: https://github.com/llvm/llvm-project/pull/150333.diff 2 Files Affected:
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 9a2950cf1648e..5334b26daac40 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -2034,7 +2034,8 @@ bool Sema::CheckAttrTarget(const ParsedAttr &AL) {
// Check whether the attribute is valid on the current target.
if (!AL.existsInTarget(Context.getTargetInfo())) {
if (AL.isRegularKeywordAttribute())
- Diag(AL.getLoc(), diag::err_keyword_not_supported_on_target);
+ Diag(AL.getLoc(), diag::err_keyword_not_supported_on_target)
+ << AL << AL.getRange();
else
DiagnoseUnknownAttribute(AL);
AL.setInvalid();
diff --git a/clang/test/Sema/unsupported-arm-streaming.cpp b/clang/test/Sema/unsupported-arm-streaming.cpp
new file mode 100644
index 0000000000000..8693dd6875d50
--- /dev/null
+++ b/clang/test/Sema/unsupported-arm-streaming.cpp
@@ -0,0 +1,3 @@
+// RUN: %clang_cc1 -x c -triple x86_64-pc-linux-gnu -fsyntax-only -verify %s
+
+void arm_streaming(void) __arm_streaming {} // expected-error {{'__arm_streaming' is not supported on this target}}
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/11/builds/20236 Here is the relevant piece of the build log for the reference
|
In llvm#141305, the attribute argument was (unintentionally) removed from the diagnostic emission. Fixes llvm#150237
In #141305, the attribute argument was (unintentionally) removed from the diagnostic emission.
Fixes #150237