Index: lib/AST/TemplateBase.cpp =================================================================== --- lib/AST/TemplateBase.cpp +++ lib/AST/TemplateBase.cpp @@ -62,6 +62,12 @@ Out << "'"; } else { Out << Val; + // Handle cases where the value is too large to fit into the underlying type + // i.e. where the unsignedness matters. + if (const BuiltinType *BT = T->getAs()) { + if (Val.isUnsigned() && Val.getBitWidth() == 64 && Val.isNegative()) + Out << "ull"; + } } }