From 67dab8589a165184ee2c4fe0e35f81bbe70cfca3 Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 5 Jun 2024 14:42:46 +0200 Subject: [PATCH] [expr.static.cast], [expr.cond], [over.call.object] Replace 'greater cv-qualification' with 'more cv-qualified' --- source/expressions.tex | 20 ++++++++------------ source/overloading.tex | 7 +++---- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/source/expressions.tex b/source/expressions.tex index 683b30137f..2de8c48c02 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -4049,9 +4049,8 @@ An lvalue of type ``\cvqual{cv1} \tcode{B}'', where \tcode{B} is a class type, can be cast to type ``reference to \cvqual{cv2} \tcode{D}'', where \tcode{D} is a complete class derived\iref{class.derived} from \tcode{B}, -if \cvqual{cv2} is the -same cv-qualification as, or greater cv-qualification than, -\cvqual{cv1}. If \tcode{B} is a virtual base class of \tcode{D} +if \cvqual{cv2}~\tcode{D} is equally as or more cv-qualified than \cvqual{cv1}~\tcode{B}. +If \tcode{B} is a virtual base class of \tcode{D} or a base class of a virtual base class of \tcode{D}, or if no valid standard conversion from ``pointer to \tcode{D}'' to ``pointer to \tcode{B}'' exists\iref{conv.ptr}, the program is ill-formed. @@ -4214,10 +4213,8 @@ A prvalue of type ``pointer to \cvqual{cv1} \tcode{B}'', where \tcode{B} is a class type, can be converted to a prvalue of type ``pointer to \cvqual{cv2} \tcode{D}'', -where \tcode{D} is a complete class derived\iref{class.derived} -from \tcode{B}, -if \cvqual{cv2} is the same cv-qualification as, -or greater cv-qualification than, \cvqual{cv1}. +where \tcode{D} is a complete class derived\iref{class.derived} from \tcode{B}, +if \cvqual{cv2}~\tcode{D} is equally as or more cv-qualified than \cvqual{cv1}~\tcode{B}. If \tcode{B} is a virtual base class of \tcode{D} or a base class of a virtual base class of \tcode{D}, or if no valid standard conversion from ``pointer to \tcode{D}'' @@ -4236,8 +4233,7 @@ \tcode{B} of type \cvqual{cv2} \tcode{T}'', where \tcode{D} is a complete class type and \tcode{B} is a base class\iref{class.derived} of \tcode{D}, -if \cvqual{cv2} is the same cv-qualification -as, or greater cv-qualification than, \cvqual{cv1}. +if \cvqual{cv2}~\tcode{T} is equally as or more cv-qualified than \cvqual{cv1}~\tcode{T}. \begin{note} Function types (including those used in pointer-to-member-function types) are never cv-qualified\iref{dcl.fct}. @@ -4261,8 +4257,8 @@ \pnum A prvalue of type ``pointer to \cvqual{cv1} \keyword{void}'' can be converted to a prvalue of type ``pointer to \cvqual{cv2} \tcode{T}'', -where \tcode{T} is an object type and \cvqual{cv2} is the same -cv-qualification as, or greater cv-qualification than, \cvqual{cv1}. +where \tcode{T} is an object type, +and \cvqual{cv2}~\tcode{T} is equally as or more cv-qualified than \cvqual{cv1}~\tcode{void}. If the original pointer value represents the address \tcode{A} of a byte in memory and \tcode{A} does not satisfy the alignment requirement of \tcode{T}, @@ -7038,7 +7034,7 @@ \begin{itemize} \item if \tcode{T1} and \tcode{T2} are the same class type (ignoring cv-qualification) and -\tcode{T2} is at least as cv-qualified as \tcode{T1}, +\tcode{T2} is equally as or more cv-qualified than \tcode{T1}, the target type is \tcode{T2}, \item otherwise, if \tcode{T2} is a base class of \tcode{T1}, diff --git a/source/overloading.tex b/source/overloading.tex index 9e1292a793..78b4939a91 100644 --- a/source/overloading.tex +++ b/source/overloading.tex @@ -546,10 +546,9 @@ \begin{ncsimplebnf} \keyword{operator} conversion-type-id \terminal{(\,)} \opt{cv-qualifier-seq} \opt{ref-qualifier} \opt{noexcept-specifier} \opt{attribute-specifier-seq} \terminal{;} \end{ncsimplebnf} -where the optional -\grammarterm{cv-qualifier-seq} -is the same cv-qualification as, or a greater cv-qualification than, -\cv{}, +where if \grammarterm{cv-qualifier-seq} is provided, +\grammarterm{cv-qualifier-seq}~\grammarterm{conversion-type-id} +is equally as or more cv-qualified than \cv{}~\tcode{T}, and where \grammarterm{conversion-type-id} denotes the type ``pointer to function