template parameter comparison against default value doesn't handle LValue (original) (raw)
An assertion is thrown here for this code. APValue is an LValue, not an Int.
This is against release/18.x
inline constexpr long ullNil = -1;
template<typename T = long, const T &Nil = ullNil>
struct Test {};
inline constexpr long lNil = -1;
Test<long, lNil> c;
#6 0x00007ff608f49f7c clang::APValue::isInt Z:\repos\llvm\clang\include\clang\AST\APValue.h:401:0
#7 0x00007ff608f49f7c clang::APValue::getInt Z:\repos\llvm\clang\include\clang\AST\APValue.h:424:0
#8 0x00007ff608f49f7c clang::Expr::EvaluateKnownConstInt(class clang::ASTContext const &, class llvm::SmallVectorImpl<struct std::pair<class clang::SourceLocation, class clang::PartialDiagnostic>> *) const Z:\repos\llvm\clang\lib\AST\ExprConstant.cpp:15862:0
#9 0x00007ff608e0e3d7 llvm::APSInt::isSameValue Z:\repos\llvm\llvm\include\llvm\ADT\APSInt.h:320:0
#10 0x00007ff608e0e3d7 templateArgumentExpressionsEqual Z:\repos\llvm\clang\lib\AST\TypePrinter.cpp:2135:0
#11 0x00007ff608e021d8 isSubstitutedTemplateArgument Z:\repos\llvm\clang\lib\AST\TypePrinter.cpp:2160:0
#12 0x00007ff608e01fec clang::isSubstitutedDefaultArgument(class clang::ASTContext &, class clang::TemplateArgument, class clang::NamedDecl const *, class llvm::ArrayRef<class clang::TemplateArgument>, unsigned int) Z:\repos\llvm\clang\lib\AST\TypePrinter.cpp:2199:0
#13 0x00007ff60824dbb3 clang::TemplateArgument::setIsDefaulted Z:\repos\llvm\clang\include\clang\AST\TemplateBase.h:389:0