-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[PAC][clang] Correct handling of ptrauth queries of incomplete types #164528
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
ojhunt
merged 2 commits into
main
from
users/ojhunt/fix-ptrauth-queries-with-nested-incomplete-types
Oct 23, 2025
+49
−1
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| // RUN: %clang_cc1 -fptrauth-intrinsics -fsyntax-only -ferror-limit 1 -verify -std=c++26 %s | ||
| // RUN: %clang_cc1 -fptrauth-intrinsics -fsyntax-only -ferror-limit 1 -verify -std=c++03 %s | ||
| // RUN: %clang_cc1 -fsyntax-only -ferror-limit 1 -verify -std=c++03 %s | ||
|
|
||
| /// Force two errors so we hit the error limit leading to skip of template instantiation | ||
| # "" // expected-error {{invalid preprocessing directive}} | ||
| # "" | ||
| // expected-error@* {{too many errors emitted}} | ||
|
|
||
| template <typename> | ||
| struct a {}; | ||
| struct test_polymorphic { | ||
| virtual ~test_polymorphic(); | ||
| a<int> field; | ||
| }; | ||
| static_assert(__is_trivially_relocatable(test_polymorphic)); | ||
|
|
||
| struct test_struct { | ||
| test_struct(int) {} | ||
| void test_instantiate() { | ||
| test_struct d(0); | ||
| } | ||
| void test_type_trait_query() { | ||
| __is_trivially_relocatable(test_struct); | ||
| } | ||
| a<int> e; | ||
| }; | ||
|
|
||
| struct test_struct2 { | ||
| test_struct member; | ||
| void test() { | ||
| test_struct2 t{.member = {0}}; | ||
| } | ||
| }; | ||
|
|
||
| struct test_subclass : test_struct { | ||
| test_subclass() : test_struct(0) { | ||
| } | ||
|
|
||
| void test_subclass_instantiation() { | ||
| test_subclass subclass{}; | ||
| } | ||
| void test_subclass_type_trait_query() { | ||
| __is_trivially_relocatable(test_subclass); | ||
| } | ||
| }; | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test without -fsyntax-only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have added, is there any difference in behavior between -fsyntax-only and not if there are errors? (i.e. do further passes running prior to the abort)