Skip to content

[BoundsSafety] Work around a regression in how macro-defined bounds-s… #10993

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 16, 2025

Conversation

rapidsna
Copy link

@rapidsna rapidsna commented Jul 11, 2025

…afety attributes are emitted in diagnostics

A recent auto-merged change from upstream
d9ef62a
seemed to remove the special handling on how macro-defined bounds-safety attributes are emitted in diagnostics. Adding the specialization for now to fix the test failure. The task to clean up the special handling of the macro defined attributes is tracked separately.

This fixes test failures in
Clang :: BoundsSafety/Sema/attributes_in_template_decls_attr_only_mode.cpp
Clang :: BoundsSafety/Sema/complex-typespecs-with-bounds.c
Clang :: BoundsSafety/Sema/terminated-by-attr.c
Clang :: BoundsSafety/Sema/unsafe-late-const.c

rdar://155652853

@rapidsna
Copy link
Author

@swift-ci test llvm

const IdentifierInfo *AttrName =
At.printMacroName() ? At.getMacroIdentifier() : At.getAttrName();
DB.AddTaggedVal(reinterpret_cast<uint64_t>(AttrName),
DiagnosticsEngine::ak_identifierinfo);

Choose a reason for hiding this comment

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

We don't want ak_attr_info?

Copy link
Author

@rapidsna rapidsna Jul 12, 2025

Choose a reason for hiding this comment

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

It's ak_identifierinfo because the type of the argument for diag engine (AttrName) is IdentifierInfo.

@rapidsna
Copy link
Author

@swift-ci test llvm

…afety attributes are emitted in diagnostics

A recent auto-merged change from upstream
d9ef62a
seemed to remove the special handling on how macro-defined bounds-safety
attributes are emitted in diagnostics. Adding the specialization for now
to fix the test failure. The task to clean up the special handling of
the macro defined attributes is tracked separately.

This fixes test failures in
  Clang :: BoundsSafety/Sema/attributes_in_template_decls_attr_only_mode.cpp
  Clang :: BoundsSafety/Sema/complex-typespecs-with-bounds.c
  Clang :: BoundsSafety/Sema/terminated-by-attr.c
  Clang :: BoundsSafety/Sema/unsafe-late-const.c

rdar://155652853
@rapidsna rapidsna force-pushed the fix-printing-macro-defined-attr branch from 44f3518 to 2862f10 Compare July 16, 2025 00:13
@rapidsna
Copy link
Author

@swift-ci test llvm

@rapidsna
Copy link
Author

These are existing failures https://smooshbase.apple.com/ci/view/BotWrangler/job/apple-clang-stage1-RA-next/67053/testReport/

Failed Tests (6):
17:57:12 Clang :: CodeGenObjC/ptrauth-attr-exception.m
17:57:12 Clang :: CodeGenObjC/ptrauth-block-isa.m
17:57:12 Clang :: CodeGenObjC/ptrauth-class-ro.m
17:57:12 Clang :: CodeGenObjC/ptrauth-objc-isa-super.m
17:57:12 Clang :: CodeGenObjC/ptrauth-objc-method-list-pointer.m
17:57:12 Clang :: SemaCXX/attr-transparent-stepping-method.cpp

@rapidsna rapidsna merged commit f5e6ed5 into next Jul 16, 2025
0 of 2 checks passed
@rapidsna rapidsna deleted the fix-printing-macro-defined-attr branch July 16, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants