Repository navigation
[Motions 2026 11 cwg 4] ready issues except 3232, 3233, 3241, and 3242 #9426
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
burblebee
wants to merge
36
commits into
main
Choose a base branch
from
motions-2026-11-cwg-4
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
6217da8
CWG3025 Deallocation functions returning void
burblebee 5a0c102
CWG3121 Zero-size arrays in function parameters
burblebee 3eea211
CWG3137 Composite pointer type with qualification and pointer-to-memb…
burblebee ef526df
CWG3144 Granularity of implementation choice for sizeof and subobject…
burblebee c603028
CWG3160 Grammar ambiguity with class member declarations
burblebee 49d9f57
CWG3163 Grammar ambiguity for nodeclspec-function-declaration
burblebee 963caf4
CWG3192 Out-of-line definition of an enum member of a local class
burblebee 510ad17
CWG3194 Lexing of <=>
burblebee b20979e
CWG3197 Relaxed requirements for integer representations
burblebee ce55ef0
CWG3199 Missing predefined macros for char16_t and char32_t
burblebee dc793d9
CWG3200 Qualified pointer pointing to unqualified object
burblebee bed57f0
CWG3201 Zero- and default-initialization of cv-qualified std::meta::info
burblebee e96f27e
CWG3204 Restrictions on arguments for ellipsis parameter
burblebee bbd416d
CWG3206 Scattered definition of "local class"
burblebee 6eda683
CWG3208 Base classes of virtual base classes
burblebee ae72121
CWG3210 constexpr for empty destructuring expansion statements
burblebee c0b037c
CWG3211 Explicitly captured variable is not odr-usable in lambda cont…
burblebee 0f091ab
CWG3213 Restrictions on the template-head of a concept definition
burblebee a85c1ba
CWG3214 Redeclaration of types and namespaces and their aliases
burblebee f7c151c
CWG3215 this in a default member initializer during constant evaluation
burblebee ae6a160
CWG3218 Expanding packs created within a pack expansion
burblebee 4982016
CWG3221 Missing Annex C entry for conflicting declarations in for-loops
burblebee dd059c2
CWG3222 Deleted module directives
burblebee 623941b
CWG3223 Undefined behavior for constructor preconditions and destruct…
burblebee eef04aa
CWG3224 Directives in multi-line macro arguments
burblebee 4f8e589
CWG3225 Conversion of bool to signed integer of width 1
burblebee 3079eee
CWG3226 Conflict of templated entity vs. enclosing template
burblebee e8176d4
CWG3227 IFNDR for always-empty packs
burblebee 643573e
CWG3228 Empty initializers vs. empty packs
burblebee 4b3d117
CWG3229 Incomplete restrictions on same meaning for same tokens
burblebee 6aca01b
CWG3230 Are non-static data members "variables"?
burblebee d7edb59
CWG3234 explicit and eligible constructors
burblebee f859ecf
CWG3235 begin-expr and end-expr should refer to range
burblebee 8bd2723
CWG3237 Missing restrictions imposed by __STDC_MB_MIGHT_NEQ_WC__
burblebee 3c21e85
CWG3238 Postcondition result bindings as declarations
burblebee 0b4f02a
CWG3240 Return object destruction from throwing postcondition evaluation
burblebee 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 |
|---|---|---|
|
|
@@ -1144,10 +1144,32 @@ | |
| \begin{itemize} | ||
| \item the function is not deleted, | ||
| \item the associated constraints\iref{temp.constr}, if any, are satisfied, and | ||
| \item no special member function of the same kind | ||
| whose associated constraints, if any, are satisfied | ||
| is more constrained\iref{temp.constr.order}. | ||
| \item there exists no special member function | ||
| \begin{itemize} | ||
| \item that is of the same kind, | ||
| \item that is not more explicit, | ||
| \item whose associated constraints, if any, are satisfied, and | ||
| \item that is more constrained\iref{temp.constr.order}, | ||
| \end{itemize} | ||
| where a function \tcode{F1} is more explicit than a function \tcode{F2} | ||
| if \tcode{F1} is explicit\iref{dcl.fct.spec} and \tcode{F2} is not. | ||
| \end{itemize} | ||
| \begin{example} | ||
| \begin{codeblock} | ||
| template<class T> | ||
| struct X { | ||
| X() = default; | ||
| X(const X&) = default; // \#1 | ||
| private: | ||
| explicit X(const X&) requires true = default; // \#2 | ||
| }; | ||
|
|
||
| int main() { | ||
| X<int> x; | ||
| X<int> x2 = x; // OK, selects \#1; both \#1 and \#2 are eligible | ||
| } | ||
| \end{codeblock} | ||
| \end{example} | ||
|
|
||
| \pnum | ||
| For a class, its direct non-static data members, its non-virtual direct base classes, | ||
|
|
@@ -1161,32 +1183,33 @@ | |
| \indextext{special member function|see{constructor}}% | ||
|
|
||
| \pnum | ||
| A \grammarterm{declarator} declares a \defn{constructor} if it is a | ||
| function declarator\iref{dcl.fct} of the form | ||
| \begin{ncbnf} | ||
| ptr-declarator \terminal{(} parameter-declaration-clause \terminal{)} \opt{noexcept-specifier} \opt{attribute-specifier-seq} | ||
| \end{ncbnf} | ||
| where the \grammarterm{ptr-declarator} consists solely of an | ||
| \grammarterm{id-expression}, an optional \grammarterm{attribute-specifier-seq}, | ||
| and optional surrounding parentheses, and the \grammarterm{id-expression} has | ||
| one of the following forms: | ||
| A \grammarterm{declaration} declares a \defn{constructor} if | ||
| \begin{itemize} | ||
| \item | ||
| in a friend declaration\iref{class.friend}, | ||
| the \grammarterm{id-expression} is a \grammarterm{qualified-id} | ||
| that names a constructor\iref{class.qual}; | ||
| the \grammarterm{declarator-id} is a \grammarterm{qualified-id} that | ||
| names a constructor\iref{class.qual}; | ||
|
|
||
| \item | ||
| otherwise, in a \grammarterm{member-declaration} that belongs to the | ||
| \grammarterm{member-specification} of a class or class template, | ||
| the \grammarterm{id-expression} is the | ||
| injected-class-name\iref{class.pre} of the immediately-enclosing entity; | ||
| otherwise, | ||
| in a \grammarterm{member-declaration} that | ||
| belongs to the \grammarterm{member-specification} of a class or class template, | ||
| the \grammarterm{declarator-id} is the injected-class-name\iref{class.pre} of | ||
| the immediately-enclosing entity; | ||
|
|
||
| \item | ||
| otherwise, the | ||
| \grammarterm{id-expression} is a \grammarterm{qualified-id} | ||
| whose \grammarterm{unqualified-id} is | ||
| the injected-class-name of its lookup context. | ||
| otherwise, | ||
| the \grammarterm{declarator-id} is a \grammarterm{qualified-id} whose | ||
| \grammarterm{unqualified-id} is the injected-class-name of its lookup context. | ||
| \end{itemize} | ||
|
|
||
| The declarator of a constructor declaration shall have the form | ||
| \begin{ncbnf} | ||
| ptr-declarator \terminal{(} parameter-declaration-clause \terminal{)} \opt{noexcept-specifier} \opt{attribute-specifier-seq} | ||
| \end{ncbnf} | ||
| where the \grammarterm{ptr-declarator} consists solely of an | ||
| \grammarterm{id-expression}, an optional \grammarterm{attribute-specifier-seq}, | ||
| and optional surrounding parentheses. | ||
| Constructors do not have names. | ||
| In a constructor declaration, each \grammarterm{decl-specifier} in the optional | ||
| \grammarterm{decl-specifier-seq} shall be | ||
|
|
@@ -3371,8 +3394,12 @@ | |
| \indextext{class!local|see{local class}}% | ||
|
|
||
| \pnum | ||
| A class can be declared within a function definition; such a class is | ||
| called a \defnadj{local}{class}. | ||
| \indextext{nested class!local class}% | ||
| A class is a \defnadj{local}{class} if | ||
| \begin{itemize} | ||
| \item its declaration inhabits a block scope or | ||
| \item it is a nested class of a local class. | ||
| \end{itemize} | ||
| \begin{note} | ||
| A declaration in a local class | ||
| cannot odr-use\iref{term.odr.use} | ||
|
|
@@ -3414,13 +3441,10 @@ | |
| definition, if they are defined at all. | ||
|
|
||
| \pnum | ||
| \indextext{nested class!local class}% | ||
| \indextext{restriction!local class}% | ||
| A class nested within | ||
| a local class is a local class. | ||
| A member of a local class \tcode{X} shall be | ||
| declared only in the definition of \tcode{X} or, | ||
| if the member is a nested class, | ||
| if the member is an enumeration or a nested class, | ||
| in the nearest enclosing block scope of \tcode{X}. | ||
|
|
||
| \pnum | ||
|
|
@@ -3669,10 +3693,12 @@ | |
| class specifier that contains the keyword \keyword{virtual} specifies a | ||
| \defnadj{virtual}{base class}. For each distinct occurrence of a | ||
| non-virtual base class in the class lattice of the most derived class, | ||
| the most derived object\iref{intro.object} shall contain a | ||
| the most derived object\iref{intro.object} contains a | ||
| corresponding distinct base class subobject of that type. For each | ||
| distinct base class that is specified virtual, the most derived object | ||
| shall contain a single base class subobject of that type. | ||
| contains a single base class subobject of that type. | ||
| A \defnadj{transitively virtual}{base class} is | ||
| a virtual base class or a base class thereof. | ||
|
|
||
| \pnum | ||
| \begin{note} | ||
|
|
@@ -5843,9 +5869,9 @@ | |
| \grammarterm{mem-initializer}{s} | ||
| for base classes have completed, | ||
| \item | ||
| a precondition assertion of a constructor, or | ||
| a precondition assertion of a constructor of the object under construction, or | ||
| \item | ||
| a postcondition assertion of a destructor\iref{dcl.contract.func}, | ||
| a postcondition assertion of the destructor of the object under destruction\iref{dcl.contract.func}, | ||
| \end{itemize} | ||
| the program has undefined behavior\ubdef{class.base.init.mem.fun}. | ||
| \begin{example} | ||
|
|
@@ -6850,4 +6876,39 @@ | |
| \end{codeblock} | ||
| \end{example} | ||
|
|
||
| \rSec2[class.mem.ambig]{Ambiguity resolution} | ||
|
|
||
| \pnum | ||
| An ambiguity can arise in a \grammarterm{member-declaration} when | ||
| a \grammarterm{type-name} is enclosed in parentheses. | ||
| In this case, the choice is between | ||
| the declaration of a function with an unnamed parameter and | ||
| the declaration of a member with redundant parentheses | ||
| around the \grammarterm{declarator-id}. | ||
| If the former interpretation would declare a function whose | ||
| name is the injected-class-name of | ||
| the enclosing class or class template and | ||
| its \grammarterm{decl-specifier-seq}, if present, | ||
| would contain neither friend nor a \grammarterm{decl-specifier} that | ||
|
Contributor
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. \keyword friend? |
||
| is not permitted for a constructor\iref{class.ctor.general}, | ||
| the former interpretation is chosen | ||
| (i.e. the \grammarterm{type-name} | ||
|
Check failure on line 6895 in source/classes.tex
|
||
| is considered a \grammarterm{simple-type-specifier} | ||
| rather than a \grammarterm{declarator-id}); | ||
| otherwise, the latter interpretation is chosen. | ||
| As in \ref{stmt.ambig}, the disambiguation | ||
| is purely syntactic and | ||
| can result in an ill-formed interpretation. | ||
| \begin{example} | ||
| \begin{codeblock} | ||
| typedef int t1, t2; | ||
| template<class> struct u1; | ||
| struct A { | ||
| A(t1); // OK, declares constructor having unnamed parameter of type \tcode{int}, not a data member named \tcode{t1} | ||
| typedef A(t2); // OK, declares \tcode{t2} as an alias for \tcode{A} | ||
| A(u1); // error: placeholder for deduced class type cannot appear in this context\iref{dcl.type.class.deduct} | ||
| }; | ||
| \end{codeblock} | ||
| \end{example} | ||
|
|
||
| \indextext{class|)} | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
resolution says to put this "Add a new subclause at the end of 11.4 [class.mem]" , but this is end of [class.compare]
I think it should go after [class.nest], just before \rSec1[class.union]