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

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

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

…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

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 drag engine (AttrName) is IdentifierInfo.

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