[Clang] Fixes __builtin_is_implicit_lifetime for types with deleted ctrs#161163
Merged
[Clang] Fixes __builtin_is_implicit_lifetime for types with deleted ctrs#161163
Conversation
Member
|
@llvm/pr-subscribers-clang Author: Corentin Jabot (cor3ntin) ChangesWe failed to check that the trivial constructor where eligible (this implies non deleted). Fixes #160610 Full diff: https://github.com/llvm/llvm-project/pull/161163.diff 3 Files Affected:
|
…ovided Ctr We failed to check that the trivial constructor where eligible (this implies non deleted). Fixes llvm#160610
erichkeane
approved these changes
Sep 29, 2025
shafik
reviewed
Sep 29, 2025
| } | ||
|
|
||
| namespace GH160610 { | ||
| class NonAggregate { |
Collaborator
There was a problem hiding this comment.
Might be worth adding a few more combinations here, like combinations of defaulted and deleted.
mahesh-attarde
pushed a commit
to mahesh-attarde/llvm-project
that referenced
this pull request
Oct 3, 2025
…trs (llvm#161163) We failed to check that the trivial constructor where eligible (this implies non deleted). Fixes llvm#160610
Contributor
|
After this change, clang fails to detect implicitly defined trivial copy constructors. The assertion fails in this code: struct S {
S();
};
//S s1;
static_assert(__builtin_is_implicit_lifetime(S));Uncomment |
Contributor
|
@cor3ntin, what do you think? |
Contributor
Author
|
I will look into it, thanks for letting me know |
cor3ntin
added a commit
to cor3ntin/llvm-project
that referenced
this pull request
Oct 9, 2025
Classes with a user provided constructor are still implicit lifetime if they have an implicit, trivial copy ctr.
cor3ntin
added a commit
to cor3ntin/llvm-project
that referenced
this pull request
Oct 15, 2025
Classes with a user provided constructor are still implicit lifetime if they have an implicit, trivial copy ctr.
cor3ntin
added a commit
that referenced
this pull request
Oct 15, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
We failed to check that the trivial constructor where eligible (this implies non deleted).
Fixes #160610