From 3b3663fbc5e4f01b325ab4630e665a4ad0917402 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 12 Nov 2019 14:26:51 -0800 Subject: [PATCH 1/6] CWG2280 Matching a usual deallocation function with placement new --- source/expressions.tex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/expressions.tex b/source/expressions.tex index 37ed18d2c0..b3423c58ea 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -5183,13 +5183,12 @@ will be called; otherwise, no deallocation function will be called. If the lookup finds a usual deallocation function -with a parameter of type \tcode{std::size_t}\iref{basic.stc.dynamic.deallocation} and that function, considered as a placement deallocation function, would have been selected as a match for the allocation function, the program is ill-formed. For a non-placement allocation function, the normal deallocation function lookup is used to find the matching deallocation -function\iref{expr.delete} +function\iref{expr.delete}. \begin{example} \begin{codeblock} struct S { From 7c32922068a1960c4619e6788412bd59877da169 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 12 Nov 2019 14:38:14 -0800 Subject: [PATCH 2/6] CWG2382 Array allocation overhead for non-allocating placement new [expr.new] Use "except" instead of "but not" to describe an exception to a prior rule. --- source/expressions.tex | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source/expressions.tex b/source/expressions.tex index b3423c58ea..bfcc1d2b39 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -4995,7 +4995,9 @@ allocation function as the first argument of type \tcode{std::size_t}. That argument shall be no less than the size of the object being created; it may be greater than the size of the -object being created only if the object is an array. For arrays of +object being created only if the object is an array and +the allocation function is not a non-allocating form\iref{new.delete.placement}. +For arrays of \tcode{char}, \tcode{unsigned char}, and \tcode{std::byte}, the difference between the result of the \grammarterm{new-expression} and the address returned by the @@ -5072,9 +5074,10 @@ representing array allocation overhead; the result of the \grammarterm{new-expression} will be offset by this amount from the value returned by \tcode{operator new[]}. This overhead may be applied in all -array \grammarterm{new-expression}{s}, including those referencing the -library function \tcode{operator new[](std::size_t, void*)} and other -placement allocation functions. The amount of overhead may vary from one +array \grammarterm{new-expression}{s}, including those referencing +a placement allocation function, except when referencing +the library function \tcode{operator new[](std::size_t, void*)}. +The amount of overhead may vary from one invocation of \tcode{new} to another. \end{example} From 4fac9c2c090270bae9bded5604dbf649ba827ec0 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 12 Nov 2019 14:41:33 -0800 Subject: [PATCH 3/6] CWG2416 Explicit specializations vs constexpr and consteval --- source/templates.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/templates.tex b/source/templates.tex index 9829037ff6..8702dfeb94 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -6698,10 +6698,10 @@ of a template specialization is not an explicit specialization\iref{temp.fct}. \pnum -An explicit specialization of a function or variable template is inline -only if it is declared with the \tcode{inline} -specifier or defined as deleted, and independently of whether its -function or variable template is inline. +The inline, constexpr, and consteval properties of +an explicit specialization of a function or variable template +are determined by the explicit specialization and +are independent of those properties of the template. \begin{example} \begin{codeblock} template void f(T) { @\commentellip@ } From b22eddb54373c8763c2a2b203a0c4a75c9e9f7e4 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 12 Nov 2019 15:02:56 -0800 Subject: [PATCH 4/6] CWG2441 Inline function parameters --- source/declarations.tex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/declarations.tex b/source/declarations.tex index ffd9809b11..9fffb9659e 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -1068,7 +1068,9 @@ \pnum The \tcode{inline} specifier shall not appear on a block scope -declaration.\footnote{The \tcode{inline} keyword has no effect on the linkage of a function.} +declaration% +\footnote{The \tcode{inline} keyword has no effect on the linkage of a function.} +or on the declaration of a function parameter. If the \tcode{inline} specifier is used in a friend function declaration, that declaration shall be a definition or the function shall have previously been declared inline. From a6f1f0000d274b406900a462297160f6de3a6d55 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 19 Nov 2019 14:46:46 -0800 Subject: [PATCH 5/6] [temp.expl.spec] There is no such thing as a "consteval property". Rephrase to use the correct term "immediate function". --- source/templates.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/templates.tex b/source/templates.tex index 8702dfeb94..462aa156d5 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -6698,10 +6698,10 @@ of a template specialization is not an explicit specialization\iref{temp.fct}. \pnum -The inline, constexpr, and consteval properties of -an explicit specialization of a function or variable template -are determined by the explicit specialization and -are independent of those properties of the template. +Whether an explicit specialization of a function or variable template +is inline, constexpr, or an immediate function +is determined by the explicit specialization and +is independent of those properties of the template. \begin{example} \begin{codeblock} template void f(T) { @\commentellip@ } From 2ea2858eda939494fce400ea265965cce6b84e1e Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 19 Nov 2019 14:51:00 -0800 Subject: [PATCH 6/6] [dcl.inline] Move note that 'inline' doesn't affect linkage somewhere more suitable. --- source/declarations.tex | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/declarations.tex b/source/declarations.tex index 9fffb9659e..1fa58dd3fa 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -1058,6 +1058,9 @@ the point of call; however, even if this inline substitution is omitted, the other rules for inline functions specified in this subclause shall still be respected. +\begin{note} +The \tcode{inline} keyword has no effect on the linkage of a function. +\end{note} \pnum A variable declaration with an \tcode{inline} specifier declares an @@ -1067,10 +1070,8 @@ A function defined within a class definition is an inline function. \pnum -The \tcode{inline} specifier shall not appear on a block scope -declaration% -\footnote{The \tcode{inline} keyword has no effect on the linkage of a function.} -or on the declaration of a function parameter. +The \tcode{inline} specifier shall not appear on a block scope declaration or +on the declaration of a function parameter. If the \tcode{inline} specifier is used in a friend function declaration, that declaration shall be a definition or the function shall have previously been declared inline.