================
@@ -17331,13 +17314,20 @@ ExprResult Sema::BuildVAArgExpr(SourceLocation 
BuiltinLoc,
       if (!PromoteType.isNull() && !UnderlyingType->isBooleanType() &&
           PromoteType->isUnsignedIntegerType() !=
               UnderlyingType->isUnsignedIntegerType()) {
-        UnderlyingType =
-            UnderlyingType->isUnsignedIntegerType()
-                ? Context.getCorrespondingSignedType(UnderlyingType)
-                : Context.getCorrespondingUnsignedType(UnderlyingType);
-        if (Context.typesAreCompatible(PromoteType, UnderlyingType,
-                                       /*CompareUnqualified*/ true))
-          PromoteType = QualType();
+
+        // Because char16_t and char32_t have no corresponding signed type,
----------------
tahonermann wrote:

I think the relevant text from the C++ standard is 
[\[conv.prom\]p6](https://eel.is/c++draft/conv.prom#6).
> A prvalue of type `char8_t`, `char16_t`, `char32_t`, or `wchar_t` 
> ([basic.fundamental]) (including a converted bit-field that was not already 
> promoted to `int` or `unsigned int` according to the rules above) can be 
> converted to a prvalue of the first of the following types that can represent 
> all the values of its underlying type: `int`, `unsigned int`, `long int`, 
> `unsigned long int`, `long long int`, `unsigned long long int`, or its 
> underlying type.

https://github.com/llvm/llvm-project/pull/195945
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to