================
@@ -3679,13 +3679,15 @@ QualType QualType::getNonLValueExprType(const 
ASTContext &Context) const {
   if (const auto *RefType = getTypePtr()->getAs<ReferenceType>())
     return RefType->getPointeeType();
 
-  // C++0x [basic.lval]:
-  //   Class prvalues can have cv-qualified types; non-class prvalues always
-  //   have cv-unqualified types.
+  // C++26 [expr.type]p2 (see also CWG1261):
+  //   If a prvalue initially has the type "cv T", where T is a cv-unqualified
+  //   non-class, non-array type, the type of the expression is adjusted to T
+  //   prior to any further analysis.
   //
   // See also C99 6.3.2.1p2.
   if (!Context.getLangOpts().CPlusPlus ||
-      (!getTypePtr()->isDependentType() && !getTypePtr()->isRecordType()))
+      (!getTypePtr()->isDependentType() && !getTypePtr()->isRecordType() &&
+       !getTypePtr()->isArrayType()))
----------------
AaronBallman wrote:

If this is a non-lvalue expression type, won't the array have been decayed to a 
pointer already?

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

Reply via email to