Reikriam

last diff?

May 4th, 2020
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.11 KB | None | 0 0
  1. diff --git a/clang/lib/AST/TemplateBase.cpp b/clang/lib/AST/TemplateBase.cpp
  2. index 0d2e54d8d9a..e5a76ade2c2 100644
  3. --- a/clang/lib/AST/TemplateBase.cpp
  4. +++ b/clang/lib/AST/TemplateBase.cpp
  5. @@ -76,13 +76,32 @@ static void printIntegral(const TemplateArgument &TemplArg,
  6. Out.write_escaped(StringRef(&Ch, 1), /*UseHexEscapes=*/ true);
  7. Out << "'";
  8. } else {
  9. - Out << Val;
  10. if (T->isBuiltinType()) {
  11. - if (Val.isUnsigned())
  12. - Out << "U";
  13. - if (Val.getBitWidth() == 64)
  14. - Out << "LL";
  15. - }
  16. + switch (cast<BuiltinType>(T)->getKind()) {
  17. + case BuiltinType::ULongLong:
  18. + Out << Val << "ULL";
  19. + break;
  20. + case BuiltinType::LongLong:
  21. + Out << Val << "LL";
  22. + break;
  23. + case BuiltinType::ULong:
  24. + Out << Val << "UL";
  25. + break;
  26. + case BuiltinType::Long:
  27. + Out << Val << "L";
  28. + break;
  29. + case BuiltinType::Int:
  30. + Out << Val;
  31. + break;
  32. + default:
  33. + if (T->isUnsignedIntegerType())
  34. + Out << Val << "U";
  35. + else
  36. + Out << "(" << T->getCanonicalTypeInternal().getAsString(Policy) << ")"
  37. + << Val;
  38. + }
  39. + } else
  40. + Out << Val;
  41. }
  42. }
  43.  
  44. diff --git a/clang/test/CXX/dcl.decl/dcl.decomp/p3.cpp b/clang/test/CXX/dcl.decl/dcl.decomp/p3.cpp
  45. index 670317a9489..3512da5a855 100644
  46. --- a/clang/test/CXX/dcl.decl/dcl.decomp/p3.cpp
  47. +++ b/clang/test/CXX/dcl.decl/dcl.decomp/p3.cpp
  48. @@ -45,13 +45,13 @@ void no_tuple_element_1() {
  49. namespace std { template<size_t, typename> struct tuple_element; } // expected-note 2{{here}}
  50.  
  51. void no_tuple_element_2() {
  52. - auto [a0, a1, a2] = A(); // expected-error {{implicit instantiation of undefined template 'std::tuple_element<0ULL, A>'}} expected-note {{in implicit}}
  53. + auto [a0, a1, a2] = A(); // expected-error {{implicit instantiation of undefined template 'std::tuple_element<0UL, A>'}} expected-note {{in implicit}}
  54. }
  55.  
  56. template<> struct std::tuple_element<0, A> { typedef float type; };
  57.  
  58. void no_tuple_element_3() {
  59. - auto [a0, a1, a2] = A(); // expected-error {{implicit instantiation of undefined template 'std::tuple_element<1ULL, A>'}} expected-note {{in implicit}}
  60. + auto [a0, a1, a2] = A(); // expected-error {{implicit instantiation of undefined template 'std::tuple_element<1UL, A>'}} expected-note {{in implicit}}
  61. }
  62.  
  63. template<> struct std::tuple_element<1, A> { typedef float &type; };
  64. diff --git a/clang/test/Misc/integer-literal-printing.cpp b/clang/test/Misc/integer-literal-printing.cpp
  65. index bd73a63f264..ba8427c56a3 100644
  66. --- a/clang/test/Misc/integer-literal-printing.cpp
  67. +++ b/clang/test/Misc/integer-literal-printing.cpp
  68. @@ -2,7 +2,7 @@
  69.  
  70. // PR11179
  71. template <short T> class Type1 {};
  72. -template <short T> void Function1(Type1<T>& x) {} // expected-note{{candidate function [with T = -42] not viable: expects an l-value for 1st argument}}
  73. +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}}
  74.  
  75. template <unsigned short T> class Type2 {};
  76. 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}}
  77. diff --git a/clang/test/SemaCXX/builtin-align-cxx.cpp b/clang/test/SemaCXX/builtin-align-cxx.cpp
  78. index 636605a6eba..1e822b36cfe 100644
  79. --- a/clang/test/SemaCXX/builtin-align-cxx.cpp
  80. +++ b/clang/test/SemaCXX/builtin-align-cxx.cpp
  81. @@ -31,10 +31,10 @@ void test_templated_arguments() {
  82. void test() {
  83. test_templated_arguments<int, 32>(); // fine
  84. test_templated_arguments<struct fwddecl, 16>();
  85. - // expected-note@-1{{in instantiation of function template specialization 'test_templated_arguments<fwddecl, 16LL, 16LL>'}}
  86. + // expected-note@-1{{in instantiation of function template specialization 'test_templated_arguments<fwddecl, 16L, 16L>'}}
  87. // expected-note@-2{{forward declaration of 'fwddecl'}}
  88. test_templated_arguments<int, 7>(); // invalid alignment value
  89. - // expected-note@-1{{in instantiation of function template specialization 'test_templated_arguments<int, 7LL, 16LL>'}}
  90. + // expected-note@-1{{in instantiation of function template specialization 'test_templated_arguments<int, 7L, 16L>'}}
  91. }
  92.  
  93. template <typename T>
  94. diff --git a/clang/test/SemaTemplate/address_space-dependent.cpp b/clang/test/SemaTemplate/address_space-dependent.cpp
  95. index 0176bc4347c..dff49cf5b1f 100644
  96. --- a/clang/test/SemaTemplate/address_space-dependent.cpp
  97. +++ b/clang/test/SemaTemplate/address_space-dependent.cpp
  98. @@ -102,7 +102,7 @@ int main() {
  99. HasASTemplateFields<1> HASTF;
  100. neg<-1>(); // expected-note {{in instantiation of function template specialization 'neg<-1>' requested here}}
  101. correct<0x7FFFF3>();
  102. - tooBig<8388650>(); // expected-note {{in instantiation of function template specialization 'tooBig<8388650LL>' requested here}}
  103. + tooBig<8388650>(); // expected-note {{in instantiation of function template specialization 'tooBig<8388650L>' requested here}}
  104.  
  105. __attribute__((address_space(1))) char *x;
  106. __attribute__((address_space(2))) char *y;
Add Comment
Please, Sign In to add comment