Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/clang/lib/AST/TemplateBase.cpp b/clang/lib/AST/TemplateBase.cpp
- index 0d2e54d8d9a..510294df66f 100644
- --- a/clang/lib/AST/TemplateBase.cpp
- +++ b/clang/lib/AST/TemplateBase.cpp
- @@ -76,13 +76,29 @@ static void printIntegral(const TemplateArgument &TemplArg,
- Out.write_escaped(StringRef(&Ch, 1), /*UseHexEscapes=*/ true);
- Out << "'";
- } else {
- - Out << Val;
- if (T->isBuiltinType()) {
- - if (Val.isUnsigned())
- - Out << "U";
- - if (Val.getBitWidth() == 64)
- - Out << "LL";
- - }
- + if (dyn_cast<BuiltinType>(T->getCanonicalTypeInternal())->getKind() ==
- + BuiltinType::ULongLong)
- + Out << Val << "ULL";
- + else if (dyn_cast<BuiltinType>(T->getCanonicalTypeInternal())
- + ->getKind() == BuiltinType::LongLong)
- + Out << Val << "LL";
- + else if (dyn_cast<BuiltinType>(T->getCanonicalTypeInternal())
- + ->getKind() == BuiltinType::ULong)
- + Out << Val << "UL";
- + else if (dyn_cast<BuiltinType>(T->getCanonicalTypeInternal())
- + ->getKind() == BuiltinType::Long)
- + Out << Val << "L";
- + else if (T->isUnsignedIntegerType())
- + Out << Val << "U";
- + else if (dyn_cast<BuiltinType>(T->getCanonicalTypeInternal())
- + ->getKind() == BuiltinType::Int)
- + Out << Val;
- + else
- + Out << "(" << T->getCanonicalTypeInternal().getAsString(Policy) << ")"
- + << Val;
- + } else
- + Out << Val;
- }
- }
- diff --git a/clang/test/CXX/dcl.decl/dcl.decomp/p3.cpp b/clang/test/CXX/dcl.decl/dcl.decomp/p3.cpp
- index 670317a9489..3512da5a855 100644
- --- a/clang/test/CXX/dcl.decl/dcl.decomp/p3.cpp
- +++ b/clang/test/CXX/dcl.decl/dcl.decomp/p3.cpp
- @@ -45,13 +45,13 @@ void no_tuple_element_1() {
- namespace std { template<size_t, typename> struct tuple_element; } // expected-note 2{{here}}
- void no_tuple_element_2() {
- - auto [a0, a1, a2] = A(); // expected-error {{implicit instantiation of undefined template 'std::tuple_element<0ULL, A>'}} expected-note {{in implicit}}
- + auto [a0, a1, a2] = A(); // expected-error {{implicit instantiation of undefined template 'std::tuple_element<0UL, A>'}} expected-note {{in implicit}}
- }
- template<> struct std::tuple_element<0, A> { typedef float type; };
- void no_tuple_element_3() {
- - auto [a0, a1, a2] = A(); // expected-error {{implicit instantiation of undefined template 'std::tuple_element<1ULL, A>'}} expected-note {{in implicit}}
- + auto [a0, a1, a2] = A(); // expected-error {{implicit instantiation of undefined template 'std::tuple_element<1UL, A>'}} expected-note {{in implicit}}
- }
- template<> struct std::tuple_element<1, A> { typedef float &type; };
- diff --git a/clang/test/Misc/integer-literal-printing.cpp b/clang/test/Misc/integer-literal-printing.cpp
- index bd73a63f264..ba8427c56a3 100644
- --- a/clang/test/Misc/integer-literal-printing.cpp
- +++ b/clang/test/Misc/integer-literal-printing.cpp
- @@ -2,7 +2,7 @@
- // PR11179
- template <short T> class Type1 {};
- -template <short T> void Function1(Type1<T>& x) {} // expected-note{{candidate function [with T = -42] not viable: expects an l-value for 1st argument}}
- +template <short T> void Function1(Type1<T>& x) {} // expected-note{{candidate function [with T = (short)-42] not viable: expects an l-value for 1st argument}}
- template <unsigned short T> class Type2 {};
- template <unsigned short T> void Function2(Type2<T>& x) {} // expected-note{{candidate function [with T = 42U] not viable: expects an l-value for 1st argument}}
- diff --git a/clang/test/SemaCXX/builtin-align-cxx.cpp b/clang/test/SemaCXX/builtin-align-cxx.cpp
- index 636605a6eba..1e822b36cfe 100644
- --- a/clang/test/SemaCXX/builtin-align-cxx.cpp
- +++ b/clang/test/SemaCXX/builtin-align-cxx.cpp
- @@ -31,10 +31,10 @@ void test_templated_arguments() {
- void test() {
- test_templated_arguments<int, 32>(); // fine
- test_templated_arguments<struct fwddecl, 16>();
- - // expected-note@-1{{in instantiation of function template specialization 'test_templated_arguments<fwddecl, 16LL, 16LL>'}}
- + // expected-note@-1{{in instantiation of function template specialization 'test_templated_arguments<fwddecl, 16L, 16L>'}}
- // expected-note@-2{{forward declaration of 'fwddecl'}}
- test_templated_arguments<int, 7>(); // invalid alignment value
- - // expected-note@-1{{in instantiation of function template specialization 'test_templated_arguments<int, 7LL, 16LL>'}}
- + // expected-note@-1{{in instantiation of function template specialization 'test_templated_arguments<int, 7L, 16L>'}}
- }
- template <typename T>
- diff --git a/clang/test/SemaTemplate/address_space-dependent.cpp b/clang/test/SemaTemplate/address_space-dependent.cpp
- index 0176bc4347c..dff49cf5b1f 100644
- --- a/clang/test/SemaTemplate/address_space-dependent.cpp
- +++ b/clang/test/SemaTemplate/address_space-dependent.cpp
- @@ -102,7 +102,7 @@ int main() {
- HasASTemplateFields<1> HASTF;
- neg<-1>(); // expected-note {{in instantiation of function template specialization 'neg<-1>' requested here}}
- correct<0x7FFFF3>();
- - tooBig<8388650>(); // expected-note {{in instantiation of function template specialization 'tooBig<8388650LL>' requested here}}
- + tooBig<8388650>(); // expected-note {{in instantiation of function template specialization 'tooBig<8388650L>' requested here}}
- __attribute__((address_space(1))) char *x;
- __attribute__((address_space(2))) char *y;
Add Comment
Please, Sign In to add comment