Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
171b459
CWG2917 Disallow multiple friend-type-specifiers for a friend template
eisenwave Nov 9, 2025
fa0d3ec
[temp.pre] Add error explanation to comment
eisenwave Nov 9, 2025
d561d81
CWG2923 Note about infinite loops and execution steps
eisenwave Nov 9, 2025
d13b700
CWG3005 Function parameters should never be name-independent
eisenwave Nov 9, 2025
3eb4722
CWG3043 Lifetime extension for temporaries in expansion statements
eisenwave Nov 9, 2025
40f6ad0
CWG3044 Iterating expansion statements woes
eisenwave Nov 9, 2025
835bdb0
CWG3045 Regularizing environment interactions of expansion statement
eisenwave Nov 9, 2025
9cc77c1
CWG3048 Empty destructuring expansion statements
eisenwave Nov 9, 2025
c0775d4
CWG3053 Allowing #undef likely
eisenwave Nov 9, 2025
dddbef9
CWG3061 Trailing comma in an expansion-init-list
eisenwave Nov 9, 2025
98bf7ee
CWG3063 Lifetime extension of temporaries past function return
eisenwave Nov 9, 2025
fe509fc
CWG3074 Redundant ill-formedness for module macros
eisenwave Nov 9, 2025
c0dfcca
CWG3082 Allow for call-compatible function types in reinterpret_cast
eisenwave Nov 9, 2025
0078561
CWG3084 compound-statements inside iteration-statements
eisenwave Nov 9, 2025
11b0144
CWG3089 const-default-constructible improperly handles std::meta::info
eisenwave Nov 9, 2025
7dca467
CWG3092 base-specifiers are not "declared"
eisenwave Nov 9, 2025
14f03aa
CWG3093 Missing integration of direct base class relationships
eisenwave Nov 9, 2025
94055b3
CWG3094 Rework phases for string literal concatenation and token form…
eisenwave Nov 9, 2025
c232b23
CWG3095 Type-dependent packs that are not structured binding packs
eisenwave Nov 9, 2025
edfd0ae
CWG3098 Remove redundancy "names or designates"
eisenwave Nov 9, 2025
c6fa234
CWG3099 Instantiation of type aliases from alias templates is unspeci…
eisenwave Nov 9, 2025
b3ac849
CWG3101 Types "compounded" from other types
eisenwave Nov 9, 2025
86619b3
CWG3108 Reflection on type aliases
eisenwave Nov 9, 2025
f6bf643
CWG3109 Access checking when designating a protected member by a splice
eisenwave Nov 9, 2025
4a044ac
CWG3110 Constexpr allocation for literal types
eisenwave Nov 9, 2025
d737b63
CWG3113 When is an expansion-init-list type-dependent?
eisenwave Nov 9, 2025
3187ac9
CWG3114 Indirect base classes for class member access with direct bas…
eisenwave Nov 9, 2025
592416f
CWG3115 Function parameters of consteval-only type
eisenwave Nov 9, 2025
69600e3
CWG3117 Overriding by a consteval virtual function
eisenwave Nov 9, 2025
80f2385
CWG3118 Mangling reflections of annotations is infeasible
eisenwave Nov 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
CWG3063 Lifetime extension of temporaries past function return
Fixes NB CA 040 (C++26 CD).
  • Loading branch information
eisenwave authored and tkoeppe committed Dec 13, 2025
commit 98bf7ee0a3b2b4e0fe823a063ec22552b76f2141
18 changes: 18 additions & 0 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3667,6 +3667,24 @@
the address of an unspecified byte of storage
occupied by the complete object of that subobject.

\pnum
The \defnx{constituent values}{constituent value} of an object $o$ are
\begin{itemize}
\item
if $o$ has scalar type, the value of $o$;
\item
otherwise, the constituent values of any direct subobjects of $o$
other than inactive union members.
\end{itemize}
The \defnx{constituent references}{constituent reference} of an object $o$ are
\begin{itemize}
\item
any direct members of $o$ that have reference type, and
\item
the constituent references of any direct subobjects of $o$
other than inactive union members.
\end{itemize}

\pnum
Some operations are described as
\defnx{implicitly creating objects}{object!implicit creation}
Expand Down
20 changes: 1 addition & 19 deletions source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -8291,31 +8291,13 @@
conditional-expression
\end{bnf}

\pnum
The \defnx{constituent values}{constituent value} of an object $o$ are
\begin{itemize}
\item
if $o$ has scalar type, the value of $o$;
\item
otherwise, the constituent values of any direct subobjects of $o$
other than inactive union members.
\end{itemize}
The \defnx{constituent references}{constituent reference} of an object $o$ are
\begin{itemize}
\item
any direct members of $o$ that have reference type, and
\item
the constituent references of any direct subobjects of $o$
other than inactive union members.
\end{itemize}

\pnum
The constituent values and constituent references of
a variable \tcode{x} are defined as follows:
\begin{itemize}
\item
If \tcode{x} declares an object,
the constituent values and references of that object are
the constituent values and references of that object\iref{intro.object} are
constituent values and references of \tcode{x}.
\item
If \tcode{x} declares a reference,
Expand Down
10 changes: 7 additions & 3 deletions source/statements.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1142,10 +1142,14 @@
\end{note}

\pnum
In a function whose return type is a reference,
In a function
other than an invented function for \tcode{std::is_convertible}\iref{meta.rel},
a \tcode{return} statement that binds the returned reference to
a temporary expression\iref{class.temporary} is ill-formed.
a \tcode{return} statement that binds
\begin{itemize}
\item a returned reference or
\item a constituent reference\iref{intro.object} of a returned object
\end{itemize}
to a temporary expression\iref{class.temporary} is ill-formed.
\begin{example}
\begin{codeblock}
auto&& f1() {
Expand Down