-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer #87933
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
Changes from 5 commits
9fba6da
5cfe844
bf6f9df
1d17c7e
8df75e2
727ccfe
cac6427
84b5a94
81eb8ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,7 +122,7 @@ void aggregateWithReferences() { | |
clang_analyzer_dump(viaReference.ry); // expected-warning-re {{&lifetime_extended_object{Composite, viaReference, S{{[0-9]+}}} }} | ||
|
||
// clang does not currently implement extending lifetime of object bound to reference members of aggregates, | ||
// that are created from default member initializer (see `warn_unsupported_lifetime_extension` from `-Wdangling`) | ||
// that are created from default member initializer (see `warn_unsupported_lifetime_extension` from `-Wdangling`) (Supported now). | ||
RefAggregate defaultInitExtended{i}; // clang-bug does not extend `Composite` | ||
clang_analyzer_dump(defaultInitExtended.ry); // expected-warning {{Unknown }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the bug is fixed, does the analyzer output not change here? In any case, the comment should explain whatever the new behavior is, and shouldn't be mentioning a warning that no longer exists. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, good catch! we need update this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please give me some time to investigate, I'm not very familiar with analyzer. |
||
} | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -10698,7 +10698,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2> | |||||
<td><a href="https://cplusplus.github.io/CWG/issues/1815.html">1815</a></td> | ||||||
<td>CD4</td> | ||||||
<td>Lifetime extension in aggregate initialization</td> | ||||||
<td class="none" align="center">No</td> | ||||||
<td class="full" align="center">Clang 19</td> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
We use a different CSS class here for features that haven't been in an official release yet. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for your tips! |
||||||
</tr> | ||||||
<tr id="1816"> | ||||||
<td><a href="https://cplusplus.github.io/CWG/issues/1816.html">1816</a></td> | ||||||
|
Uh oh!
There was an error while loading. Please reload this page.