diff --git a/clang/lib/AST/ByteCode/Pointer.cpp b/clang/lib/AST/ByteCode/Pointer.cpp index 0ad47645d39cc..08eec8172cd4e 100644 --- a/clang/lib/AST/ByteCode/Pointer.cpp +++ b/clang/lib/AST/ByteCode/Pointer.cpp @@ -207,7 +207,7 @@ APValue Pointer::toAPValue(const ASTContext &ASTCtx) const { bool UsePath = true; if (const ValueDecl *VD = getDeclDesc()->asValueDecl(); - VD && VD->getType()->isLValueReferenceType()) + VD && VD->getType()->isReferenceType()) UsePath = false; // Build the path into the object. diff --git a/clang/test/AST/ByteCode/libcxx/rvalue-reference-param.cpp b/clang/test/AST/ByteCode/libcxx/rvalue-reference-param.cpp new file mode 100644 index 0000000000000..0e8127d27f888 --- /dev/null +++ b/clang/test/AST/ByteCode/libcxx/rvalue-reference-param.cpp @@ -0,0 +1,122 @@ +// RUN: %clang_cc1 -std=c++2c -verify=expected,both %s -fexperimental-new-constant-interpreter +// RUN: %clang_cc1 -std=c++2c -verify=ref,both %s + +template struct integral_constant { + static const int value = __v; +}; +template using _BoolConstant = integral_constant<_Val>; +template +constexpr bool is_convertible_v = __is_convertible(_From, _To); +template _Tp __declval(int); +template decltype(__declval<_Tp>(0)) declval(); +template +using _IsSame = _BoolConstant<__is_same(_Tp, _Up)>; +template struct conditional { + using type = _If; +}; +template +using conditional_t = conditional<_IfRes>::type; +template +concept __weakly_equality_comparable_with = requires(_Tp __t) { __t; }; +template using __enable_if_t = _Tp; +template