Reikriam

clang-diff-suffixnew

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