Reikriam

clang-richard-new

Jun 1st, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.84 KB | None | 0 0
  1. diff --git a/clang/lib/AST/TemplateBase.cpp b/clang/lib/AST/TemplateBase.cpp
  2. index 6a3d2b30e46..35ed69ccf9f 100644
  3. --- a/clang/lib/AST/TemplateBase.cpp
  4. +++ b/clang/lib/AST/TemplateBase.cpp
  5. @@ -70,13 +70,45 @@ static void printIntegral(const TemplateArgument &TemplArg,
  6.  
  7. if (T->isBooleanType() && !Policy.MSVCFormatting) {
  8. Out << (Val.getBoolValue() ? "true" : "false");
  9. + } else if (T->isBooleanType()) {
  10. + Out << Val;
  11. } else if (T->isCharType()) {
  12. const char Ch = Val.getZExtValue();
  13. Out << ((Ch == '\'') ? "'\\" : "'");
  14. Out.write_escaped(StringRef(&Ch, 1), /*UseHexEscapes=*/ true);
  15. Out << "'";
  16. + } else if (auto *DT = T->getContainedDeducedType()) {
  17. + if (DT->isDeduced()) {
  18. + Out << Val;
  19. + }
  20. } else {
  21. - Out << Val;
  22. + if (auto *BT = T->getAs<BuiltinType>()) {
  23. + switch (BT->getKind()) {
  24. + case BuiltinType::ULongLong:
  25. + Out << Val << "ULL";
  26. + break;
  27. + case BuiltinType::LongLong:
  28. + Out << Val << "LL";
  29. + break;
  30. + case BuiltinType::ULong:
  31. + Out << Val << "UL";
  32. + break;
  33. + case BuiltinType::Long:
  34. + Out << Val << "L";
  35. + break;
  36. + case BuiltinType::UInt:
  37. + Out << Val << "U";
  38. + break;
  39. + case BuiltinType::Int:
  40. + Out << Val;
  41. + break;
  42. + default:
  43. + Out << "(" << T->getCanonicalTypeInternal().getAsString(Policy) << ")"
  44. + << Val;
  45. + break;
  46. + }
  47. + } else
  48. + Out << Val;
  49. }
  50. }
  51.  
  52. diff --git a/clang/test/CXX/dcl.decl/dcl.decomp/p3.cpp b/clang/test/CXX/dcl.decl/dcl.decomp/p3.cpp
  53. index ce5eefc6bfd..3512da5a855 100644
  54. --- a/clang/test/CXX/dcl.decl/dcl.decomp/p3.cpp
  55. +++ b/clang/test/CXX/dcl.decl/dcl.decomp/p3.cpp
  56. @@ -45,13 +45,13 @@ void no_tuple_element_1() {
  57. namespace std { template<size_t, typename> struct tuple_element; } // expected-note 2{{here}}
  58.  
  59. void no_tuple_element_2() {
  60. - auto [a0, a1, a2] = A(); // expected-error {{implicit instantiation of undefined template 'std::tuple_element<0, A>'}} expected-note {{in implicit}}
  61. + auto [a0, a1, a2] = A(); // expected-error {{implicit instantiation of undefined template 'std::tuple_element<0UL, A>'}} expected-note {{in implicit}}
  62. }
  63.  
  64. template<> struct std::tuple_element<0, A> { typedef float type; };
  65.  
  66. void no_tuple_element_3() {
  67. - auto [a0, a1, a2] = A(); // expected-error {{implicit instantiation of undefined template 'std::tuple_element<1, A>'}} expected-note {{in implicit}}
  68. + auto [a0, a1, a2] = A(); // expected-error {{implicit instantiation of undefined template 'std::tuple_element<1UL, A>'}} expected-note {{in implicit}}
  69. }
  70.  
  71. template<> struct std::tuple_element<1, A> { typedef float &type; };
  72. diff --git a/clang/test/CXX/lex/lex.literal/lex.ext/p12.cpp b/clang/test/CXX/lex/lex.literal/lex.ext/p12.cpp
  73. index 34a2f5c6782..9fb51b8c9eb 100644
  74. --- a/clang/test/CXX/lex/lex.literal/lex.ext/p12.cpp
  75. +++ b/clang/test/CXX/lex/lex.literal/lex.ext/p12.cpp
  76. @@ -8,7 +8,7 @@ struct check<char16_t, 34, 1090, 1077, 1089, 1090, 32, 55296, 56320>{};
  77. template<>
  78. struct check<char32_t, 34, 1090, 1077, 1089, 1090, 32, 65536>{};
  79. template<typename T, T... str> int operator""_x() { // #1 expected-warning {{string literal operator templates are a GNU extension}}
  80. - check<T, str...> chars; // expected-error {{implicit instantiation of undefined template 'check<char, 't', 'e', 's', 't'>'}} expected-error {{implicit instantiation of undefined template 'check<char32_t, 34, 1090, 1077, 1089, 1090, 95, 65536>'}}
  81. + check<T, str...> chars; // expected-error {{implicit instantiation of undefined template 'check<char, 't', 'e', 's', 't'>'}} expected-error {{implicit instantiation of undefined template 'check<char32_t, (char32_t)34, (char32_t)1090, (char32_t)1077, (char32_t)1089, (char32_t)1090, (char32_t)95, (char32_t)65536>'}}
  82. return 1;
  83. }
  84. void *operator""_x(const char*); // #2
  85. @@ -18,4 +18,4 @@ int c = u8R"("ั‚ะตัั‚ ๐€€)"_x; // ok, calls #1
  86. int d = "test"_x; // expected-note {{in instantiation of function template specialization 'operator""_x<char, 't', 'e', 's', 't'>' requested here}}
  87. int e = uR"("ั‚ะตัั‚ ๐€€)"_x;
  88. int f = UR"("ั‚ะตัั‚ ๐€€)"_x;
  89. -int g = UR"("ั‚ะตัั‚_๐€€)"_x; // expected-note {{in instantiation of function template specialization 'operator""_x<char32_t, 34, 1090, 1077, 1089, 1090, 95, 65536>' requested here}}
  90. +int g = UR"("ั‚ะตัั‚_๐€€)"_x; // expected-note {{in instantiation of function template specialization 'operator""_x<char32_t, (char32_t)34, (char32_t)1090, (char32_t)1077, (char32_t)1089, (char32_t)1090, (char32_t)95, (char32_t)65536>' requested here}}
  91. diff --git a/clang/test/CodeGenCXX/debug-info-template.cpp b/clang/test/CodeGenCXX/debug-info-template.cpp
  92. index a07222ace15..4997e868734 100644
  93. --- a/clang/test/CodeGenCXX/debug-info-template.cpp
  94. +++ b/clang/test/CodeGenCXX/debug-info-template.cpp
  95. @@ -1,6 +1,6 @@
  96. // RUN: %clang -S -emit-llvm -target x86_64-unknown_unknown -g %s -o - -std=c++11 | FileCheck %s
  97.  
  98. -// CHECK: @tci = dso_local global %"struct.TC<unsigned int, 2, &glb, &foo::e, &foo::f, &foo::g, 1, 2, 3>::nested" zeroinitializer, align 1, !dbg [[TCI:![0-9]+]]
  99. +// CHECK: @tci = dso_local global %"struct.TC<unsigned int, 2U, &glb, &foo::e, &foo::f, &foo::g, 1, 2, 3>::nested" zeroinitializer, align 1, !dbg [[TCI:![0-9]+]]
  100. // CHECK: @tcn = dso_local global %struct.TC zeroinitializer, align 1, !dbg [[TCN:![0-9]+]]
  101. // CHECK: @nn = dso_local global %struct.NN zeroinitializer, align 1, !dbg [[NN:![0-9]+]]
  102.  
  103. @@ -31,7 +31,7 @@ void func();
  104. // CHECK: ![[TCNESTED]] ={{.*}}!DICompositeType(tag: DW_TAG_structure_type, name: "nested",
  105. // CHECK-SAME: scope: ![[TC:[0-9]+]],
  106.  
  107. -// CHECK: ![[TC]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "TC<unsigned int, 2, &glb, &foo::e, &foo::f, &foo::g, 1, 2, 3>"
  108. +// CHECK: ![[TC]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "TC<unsigned int, 2U, &glb, &foo::e, &foo::f, &foo::g, 1, 2, 3>"
  109. // CHECK-SAME: templateParams: [[TCARGS:![0-9]*]]
  110. TC
  111. // CHECK: [[TCARGS]] = !{[[TCARG1:![0-9]*]], [[TCARG2:![0-9]*]], [[TCARG3:![0-9]*]], [[TCARG4:![0-9]*]], [[TCARG5:![0-9]*]], [[TCARG6:![0-9]*]], [[TCARG7:![0-9]*]]}
  112. diff --git a/clang/test/Index/print-type.cpp b/clang/test/Index/print-type.cpp
  113. index abe8d45c41d..b5566888027 100644
  114. --- a/clang/test/Index/print-type.cpp
  115. +++ b/clang/test/Index/print-type.cpp
  116. @@ -132,7 +132,7 @@ inline namespace InlineNS {}
  117. // CHECK: TypedefDecl=OtherType:26:18 (Definition) [type=outer::inner::Bar::OtherType] [typekind=Typedef] [canonicaltype=double] [canonicaltypekind=Double] [isPOD=1]
  118. // CHECK: TypedefDecl=ArrayType:27:15 (Definition) [type=outer::inner::Bar::ArrayType] [typekind=Typedef] [canonicaltype=int [5]] [canonicaltypekind=ConstantArray] [isPOD=1]
  119. // CHECK: IntegerLiteral= [type=int] [typekind=Int] [isPOD=1]
  120. -// CHECK: FieldDecl=baz:28:20 (Definition) [type=Baz<int, 1, Foo>] [typekind=Unexposed] [templateargs/3= [type=int] [typekind=Int]] [canonicaltype=outer::Baz<int, 1, Foo>] [canonicaltypekind=Record] [canonicaltemplateargs/3= [type=int] [typekind=Int]] [isPOD=1]
  121. +// CHECK: FieldDecl=baz:28:20 (Definition) [type=Baz<int, 1, Foo>] [typekind=Unexposed] [templateargs/3= [type=int] [typekind=Int]] [canonicaltype=outer::Baz<int, 1U, Foo>] [canonicaltypekind=Record] [canonicaltemplateargs/3= [type=int] [typekind=Int]] [isPOD=1]
  122. // CHECK: TemplateRef=Baz:9:8 [type=] [typekind=Invalid] [isPOD=0]
  123. // CHECK: IntegerLiteral= [type=int] [typekind=Int] [isPOD=1]
  124. // CHECK: TemplateRef=Foo:4:8 [type=] [typekind=Invalid] [isPOD=0]
  125. diff --git a/clang/test/Misc/integer-literal-printing.cpp b/clang/test/Misc/integer-literal-printing.cpp
  126. index 74bd8d09a92..dc0806a8756 100644
  127. --- a/clang/test/Misc/integer-literal-printing.cpp
  128. +++ b/clang/test/Misc/integer-literal-printing.cpp
  129. @@ -2,10 +2,10 @@
  130.  
  131. // PR11179
  132. template <short T> class Type1 {};
  133. -template <short T> void Function1(Type1<T>& x) {} // expected-note{{candidate function [with T = -42] not viable: expects an l-value for 1st argument}}
  134. +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}}
  135.  
  136. template <unsigned short T> class Type2 {};
  137. -template <unsigned short T> void Function2(Type2<T>& x) {} // expected-note{{candidate function [with T = 42] not viable: expects an l-value for 1st argument}}
  138. +template <unsigned short T> void Function2(Type2<T>& x) {} // expected-note{{candidate function [with T = (unsigned short)42] not viable: expects an l-value for 1st argument}}
  139.  
  140. enum class boolTy : bool {
  141. b = 0,
  142. diff --git a/clang/test/Modules/lsv-debuginfo.cpp b/clang/test/Modules/lsv-debuginfo.cpp
  143. index 30d3c2583fb..d4c646146b3 100644
  144. --- a/clang/test/Modules/lsv-debuginfo.cpp
  145. +++ b/clang/test/Modules/lsv-debuginfo.cpp
  146. @@ -26,14 +26,14 @@
  147. // CHECK: @__clang_ast =
  148.  
  149. // This type isn't anchored anywhere, expect a full definition.
  150. -// CHECK: !DICompositeType({{.*}}, name: "AlignedCharArray<4, 16>",
  151. +// CHECK: !DICompositeType({{.*}}, name: "AlignedCharArray<4U, 16U>",
  152. // CHECK-SAME: elements:
  153.  
  154. // C
  155. // CHECK: @__clang_ast =
  156.  
  157. // Here, too.
  158. -// CHECK: !DICompositeType({{.*}}, name: "AlignedCharArray<4, 16>",
  159. +// CHECK: !DICompositeType({{.*}}, name: "AlignedCharArray<4U, 16U>",
  160. // CHECK-SAME: elements:
  161.  
  162. #include <B/B.h>
  163. diff --git a/clang/test/SemaCXX/builtin-align-cxx.cpp b/clang/test/SemaCXX/builtin-align-cxx.cpp
  164. index 190f352c26d..1e822b36cfe 100644
  165. --- a/clang/test/SemaCXX/builtin-align-cxx.cpp
  166. +++ b/clang/test/SemaCXX/builtin-align-cxx.cpp
  167. @@ -31,10 +31,10 @@ void test_templated_arguments() {
  168. void test() {
  169. test_templated_arguments<int, 32>(); // fine
  170. test_templated_arguments<struct fwddecl, 16>();
  171. - // expected-note@-1{{in instantiation of function template specialization 'test_templated_arguments<fwddecl, 16, 16>'}}
  172. + // expected-note@-1{{in instantiation of function template specialization 'test_templated_arguments<fwddecl, 16L, 16L>'}}
  173. // expected-note@-2{{forward declaration of 'fwddecl'}}
  174. test_templated_arguments<int, 7>(); // invalid alignment value
  175. - // expected-note@-1{{in instantiation of function template specialization 'test_templated_arguments<int, 7, 16>'}}
  176. + // expected-note@-1{{in instantiation of function template specialization 'test_templated_arguments<int, 7L, 16L>'}}
  177. }
  178.  
  179. template <typename T>
  180. diff --git a/clang/test/SemaCXX/cxx11-ast-print.cpp b/clang/test/SemaCXX/cxx11-ast-print.cpp
  181. index 17dcbcb3f7b..56d263fbcf4 100644
  182. --- a/clang/test/SemaCXX/cxx11-ast-print.cpp
  183. +++ b/clang/test/SemaCXX/cxx11-ast-print.cpp
  184. @@ -40,7 +40,7 @@ const char *p9 = 0x42e3F_fritz;
  185. const char *p10 = 3.300e+15_fritz;
  186.  
  187. template <class C, C...> const char *operator"" _suffix();
  188. -// CHECK: const char *PR23120 = operator""_suffix<char32_t, 66615>();
  189. +// CHECK: const char *PR23120 = operator""_suffix<char32_t, (char32_t)66615>();
  190. const char *PR23120 = U"๐ท"_suffix;
  191.  
  192. // PR28885
  193. diff --git a/clang/test/SemaCXX/cxx11-call-to-deleted-constructor.cpp b/clang/test/SemaCXX/cxx11-call-to-deleted-constructor.cpp
  194. index dd043452816..65ccdca9620 100644
  195. --- a/clang/test/SemaCXX/cxx11-call-to-deleted-constructor.cpp
  196. +++ b/clang/test/SemaCXX/cxx11-call-to-deleted-constructor.cpp
  197. @@ -34,7 +34,7 @@ void getLaplacianClosedForm()
  198. {
  199. Matrix<double> winI(0, 3);
  200. RGBFValue* inputPreL;
  201. - winI = { inputPreL->at() }; // expected-error {{call to deleted constructor of 'cva::Matrix<double, 0, 0> &&'}}
  202. + winI = { inputPreL->at() }; // expected-error {{call to deleted constructor of 'cva::Matrix<double, 0U, 0U> &&'}}
  203. }
  204.  
  205. }
  206. diff --git a/clang/test/SemaCXX/invalid-instantiated-field-decl.cpp b/clang/test/SemaCXX/invalid-instantiated-field-decl.cpp
  207. index 8b26489d94d..901d6ba71ca 100644
  208. --- a/clang/test/SemaCXX/invalid-instantiated-field-decl.cpp
  209. +++ b/clang/test/SemaCXX/invalid-instantiated-field-decl.cpp
  210. @@ -31,5 +31,5 @@ class CallSite; // expected-note {{forward declaration of 'CallSite'}}
  211. class InlineFunctionInfo {
  212. public:
  213. explicit InlineFunctionInfo() {}
  214. - SmallVector<CallSite, 2> DevirtualizedCalls; // expected-note {{in instantiation of template class 'SmallVector<CallSite, 2>' requested}}
  215. + SmallVector<CallSite, 2> DevirtualizedCalls; // expected-note {{in instantiation of template class 'SmallVector<CallSite, 2U>' requested}}
  216. };
  217. diff --git a/clang/test/SemaCXX/matrix-type-operators.cpp b/clang/test/SemaCXX/matrix-type-operators.cpp
  218. index 153f89a2136..d458c15540e 100644
  219. --- a/clang/test/SemaCXX/matrix-type-operators.cpp
  220. +++ b/clang/test/SemaCXX/matrix-type-operators.cpp
  221. @@ -12,13 +12,13 @@ struct MyMatrix {
  222. template <typename EltTy0, unsigned R0, unsigned C0, typename EltTy1, unsigned R1, unsigned C1, typename EltTy2, unsigned R2, unsigned C2>
  223. typename MyMatrix<EltTy2, R2, C2>::matrix_t add(MyMatrix<EltTy0, R0, C0> &A, MyMatrix<EltTy1, R1, C1> &B) {
  224. char *v1 = A.value + B.value;
  225. - // expected-error@-1 {{cannot initialize a variable of type 'char *' with an rvalue of type 'MyMatrix<unsigned int, 2, 2>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))')}}
  226. - // expected-error@-2 {{invalid operands to binary expression ('MyMatrix<unsigned int, 3, 3>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))') and 'MyMatrix<float, 2, 2>::matrix_t' (aka 'float __attribute__((matrix_type(2, 2)))'))}}
  227. - // expected-error@-3 {{invalid operands to binary expression ('MyMatrix<unsigned int, 2, 2>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))') and 'MyMatrix<unsigned int, 3, 3>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))'))}}
  228. + // expected-error@-1 {{cannot initialize a variable of type 'char *' with an rvalue of type 'MyMatrix<unsigned int, 2U, 2U>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))')}}
  229. + // expected-error@-2 {{invalid operands to binary expression ('MyMatrix<unsigned int, 3U, 3U>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))') and 'MyMatrix<float, 2U, 2U>::matrix_t' (aka 'float __attribute__((matrix_type(2, 2)))'))}}
  230. + // expected-error@-3 {{invalid operands to binary expression ('MyMatrix<unsigned int, 2U, 2U>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))') and 'MyMatrix<unsigned int, 3U, 3U>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))'))}}
  231.  
  232. return A.value + B.value;
  233. - // expected-error@-1 {{invalid operands to binary expression ('MyMatrix<unsigned int, 3, 3>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))') and 'MyMatrix<float, 2, 2>::matrix_t' (aka 'float __attribute__((matrix_type(2, 2)))'))}}
  234. - // expected-error@-2 {{invalid operands to binary expression ('MyMatrix<unsigned int, 2, 2>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))') and 'MyMatrix<unsigned int, 3, 3>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))'))}}
  235. + // expected-error@-1 {{invalid operands to binary expression ('MyMatrix<unsigned int, 3U, 3U>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))') and 'MyMatrix<float, 2U, 2U>::matrix_t' (aka 'float __attribute__((matrix_type(2, 2)))'))}}
  236. + // expected-error@-2 {{invalid operands to binary expression ('MyMatrix<unsigned int, 2U, 2U>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))') and 'MyMatrix<unsigned int, 3U, 3U>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))'))}}
  237. }
  238.  
  239. void test_add_template(unsigned *Ptr1, float *Ptr2) {
  240. @@ -28,25 +28,25 @@ void test_add_template(unsigned *Ptr1, float *Ptr2) {
  241. Mat1.value = *((decltype(Mat1)::matrix_t *)Ptr1);
  242. unsigned v1 = add<unsigned, 2, 2, unsigned, 2, 2, unsigned, 2, 2>(Mat1, Mat1);
  243. // expected-error@-1 {{cannot initialize a variable of type 'unsigned int' with an rvalue of type 'typename MyMatrix<unsigned int, 2U, 2U>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))')}}
  244. - // expected-note@-2 {{in instantiation of function template specialization 'add<unsigned int, 2, 2, unsigned int, 2, 2, unsigned int, 2, 2>' requested here}}
  245. + // expected-note@-2 {{in instantiation of function template specialization 'add<unsigned int, 2U, 2U, unsigned int, 2U, 2U, unsigned int, 2U, 2U>' requested here}}
  246.  
  247. Mat1.value = add<unsigned, 2, 2, unsigned, 3, 3, unsigned, 2, 2>(Mat1, Mat2);
  248. - // expected-note@-1 {{in instantiation of function template specialization 'add<unsigned int, 2, 2, unsigned int, 3, 3, unsigned int, 2, 2>' requested here}}
  249. + // expected-note@-1 {{in instantiation of function template specialization 'add<unsigned int, 2U, 2U, unsigned int, 3U, 3U, unsigned int, 2U, 2U>' requested here}}
  250.  
  251. Mat1.value = add<unsigned, 3, 3, float, 2, 2, unsigned, 2, 2>(Mat2, Mat3);
  252. - // expected-note@-1 {{in instantiation of function template specialization 'add<unsigned int, 3, 3, float, 2, 2, unsigned int, 2, 2>' requested here}}
  253. + // expected-note@-1 {{in instantiation of function template specialization 'add<unsigned int, 3U, 3U, float, 2U, 2U, unsigned int, 2U, 2U>' requested here}}
  254. }
  255.  
  256. template <typename EltTy0, unsigned R0, unsigned C0, typename EltTy1, unsigned R1, unsigned C1, typename EltTy2, unsigned R2, unsigned C2>
  257. typename MyMatrix<EltTy2, R2, C2>::matrix_t subtract(MyMatrix<EltTy0, R0, C0> &A, MyMatrix<EltTy1, R1, C1> &B) {
  258. char *v1 = A.value - B.value;
  259. - // expected-error@-1 {{cannot initialize a variable of type 'char *' with an rvalue of type 'MyMatrix<unsigned int, 2, 2>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))')}}
  260. - // expected-error@-2 {{invalid operands to binary expression ('MyMatrix<unsigned int, 3, 3>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))') and 'MyMatrix<float, 2, 2>::matrix_t' (aka 'float __attribute__((matrix_type(2, 2)))')}}
  261. - // expected-error@-3 {{invalid operands to binary expression ('MyMatrix<unsigned int, 2, 2>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))') and 'MyMatrix<unsigned int, 3, 3>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))')}}
  262. + // expected-error@-1 {{cannot initialize a variable of type 'char *' with an rvalue of type 'MyMatrix<unsigned int, 2U, 2U>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))')}}
  263. + // expected-error@-2 {{invalid operands to binary expression ('MyMatrix<unsigned int, 3U, 3U>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))') and 'MyMatrix<float, 2U, 2U>::matrix_t' (aka 'float __attribute__((matrix_type(2, 2)))')}}
  264. + // expected-error@-3 {{invalid operands to binary expression ('MyMatrix<unsigned int, 2U, 2U>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))') and 'MyMatrix<unsigned int, 3U, 3U>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))')}}
  265.  
  266. return A.value - B.value;
  267. - // expected-error@-1 {{invalid operands to binary expression ('MyMatrix<unsigned int, 3, 3>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))') and 'MyMatrix<float, 2, 2>::matrix_t' (aka 'float __attribute__((matrix_type(2, 2)))')}}
  268. - // expected-error@-2 {{invalid operands to binary expression ('MyMatrix<unsigned int, 2, 2>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))') and 'MyMatrix<unsigned int, 3, 3>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))')}}
  269. + // expected-error@-1 {{invalid operands to binary expression ('MyMatrix<unsigned int, 3U, 3U>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))') and 'MyMatrix<float, 2U, 2U>::matrix_t' (aka 'float __attribute__((matrix_type(2, 2)))')}}
  270. + // expected-error@-2 {{invalid operands to binary expression ('MyMatrix<unsigned int, 2U, 2U>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))') and 'MyMatrix<unsigned int, 3U, 3U>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(3, 3)))')}}
  271. }
  272.  
  273. void test_subtract_template(unsigned *Ptr1, float *Ptr2) {
  274. @@ -56,13 +56,13 @@ void test_subtract_template(unsigned *Ptr1, float *Ptr2) {
  275. Mat1.value = *((decltype(Mat1)::matrix_t *)Ptr1);
  276. unsigned v1 = subtract<unsigned, 2, 2, unsigned, 2, 2, unsigned, 2, 2>(Mat1, Mat1);
  277. // expected-error@-1 {{cannot initialize a variable of type 'unsigned int' with an rvalue of type 'typename MyMatrix<unsigned int, 2U, 2U>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 2)))')}}
  278. - // expected-note@-2 {{in instantiation of function template specialization 'subtract<unsigned int, 2, 2, unsigned int, 2, 2, unsigned int, 2, 2>' requested here}}
  279. + // expected-note@-2 {{in instantiation of function template specialization 'subtract<unsigned int, 2U, 2U, unsigned int, 2U, 2U, unsigned int, 2U, 2U>' requested here}}
  280.  
  281. Mat1.value = subtract<unsigned, 2, 2, unsigned, 3, 3, unsigned, 2, 2>(Mat1, Mat2);
  282. - // expected-note@-1 {{in instantiation of function template specialization 'subtract<unsigned int, 2, 2, unsigned int, 3, 3, unsigned int, 2, 2>' requested here}}
  283. + // expected-note@-1 {{in instantiation of function template specialization 'subtract<unsigned int, 2U, 2U, unsigned int, 3U, 3U, unsigned int, 2U, 2U>' requested here}}
  284.  
  285. Mat1.value = subtract<unsigned, 3, 3, float, 2, 2, unsigned, 2, 2>(Mat2, Mat3);
  286. - // expected-note@-1 {{in instantiation of function template specialization 'subtract<unsigned int, 3, 3, float, 2, 2, unsigned int, 2, 2>' requested here}}
  287. + // expected-note@-1 {{in instantiation of function template specialization 'subtract<unsigned int, 3U, 3U, float, 2U, 2U, unsigned int, 2U, 2U>' requested here}}
  288. }
  289.  
  290. struct UserT {};
  291. @@ -77,17 +77,17 @@ struct StructWithC {
  292. void test_DoubleWrapper(MyMatrix<double, 10, 9> &m, StructWithC &c) {
  293. m.value = m.value + c;
  294. // expected-error@-1 {{no viable conversion from 'StructWithC' to 'double'}}
  295. - // expected-error@-2 {{invalid operands to binary expression ('MyMatrix<double, 10, 9>::matrix_t' (aka 'double __attribute__((matrix_type(10, 9)))') and 'StructWithC')}}
  296. + // expected-error@-2 {{invalid operands to binary expression ('MyMatrix<double, 10U, 9U>::matrix_t' (aka 'double __attribute__((matrix_type(10, 9)))') and 'StructWithC')}}
  297.  
  298. m.value = c + m.value;
  299. // expected-error@-1 {{no viable conversion from 'StructWithC' to 'double'}}
  300. - // expected-error@-2 {{invalid operands to binary expression ('StructWithC' and 'MyMatrix<double, 10, 9>::matrix_t' (aka 'double __attribute__((matrix_type(10, 9)))'))}}
  301. + // expected-error@-2 {{invalid operands to binary expression ('StructWithC' and 'MyMatrix<double, 10U, 9U>::matrix_t' (aka 'double __attribute__((matrix_type(10, 9)))'))}}
  302.  
  303. m.value = m.value - c;
  304. // expected-error@-1 {{no viable conversion from 'StructWithC' to 'double'}}
  305. - // expected-error@-2 {{invalid operands to binary expression ('MyMatrix<double, 10, 9>::matrix_t' (aka 'double __attribute__((matrix_type(10, 9)))') and 'StructWithC')}}
  306. + // expected-error@-2 {{invalid operands to binary expression ('MyMatrix<double, 10U, 9U>::matrix_t' (aka 'double __attribute__((matrix_type(10, 9)))') and 'StructWithC')}}
  307.  
  308. m.value = c - m.value;
  309. // expected-error@-1 {{no viable conversion from 'StructWithC' to 'double'}}
  310. - // expected-error@-2 {{invalid operands to binary expression ('StructWithC' and 'MyMatrix<double, 10, 9>::matrix_t' (aka 'double __attribute__((matrix_type(10, 9)))'))}}
  311. + // expected-error@-2 {{invalid operands to binary expression ('StructWithC' and 'MyMatrix<double, 10U, 9U>::matrix_t' (aka 'double __attribute__((matrix_type(10, 9)))'))}}
  312. }
  313. diff --git a/clang/test/SemaCXX/vector.cpp b/clang/test/SemaCXX/vector.cpp
  314. index 724ccece0c4..d263c1e05fd 100644
  315. --- a/clang/test/SemaCXX/vector.cpp
  316. +++ b/clang/test/SemaCXX/vector.cpp
  317. @@ -351,20 +351,20 @@ void Init() {
  318. const TemplateVectorType<float, 32>::type Works = {};
  319. const TemplateVectorType<int, 32>::type Works2 = {};
  320. // expected-error@#1 {{invalid vector element type 'bool'}}
  321. - // expected-note@+1 {{in instantiation of template class 'Templates::TemplateVectorType<bool, 32>' requested here}}
  322. + // expected-note@+1 {{in instantiation of template class 'Templates::TemplateVectorType<bool, 32ULL>' requested here}}
  323. const TemplateVectorType<bool, 32>::type NoBool = {};
  324. // expected-error@#1 {{invalid vector element type 'int __attribute__((ext_vector_type(4)))' (vector of 4 'int' values)}}
  325. - // expected-note@+1 {{in instantiation of template class 'Templates::TemplateVectorType<int __attribute__((ext_vector_type(4))), 32>' requested here}}
  326. + // expected-note@+1 {{in instantiation of template class 'Templates::TemplateVectorType<int __attribute__((ext_vector_type(4))), 32ULL>' requested here}}
  327. const TemplateVectorType<vi4, 32>::type NoComplex = {};
  328. // expected-error@#1 {{vector size not an integral multiple of component size}}
  329. - // expected-note@+1 {{in instantiation of template class 'Templates::TemplateVectorType<int, 33>' requested here}}
  330. + // expected-note@+1 {{in instantiation of template class 'Templates::TemplateVectorType<int, 33ULL>' requested here}}
  331. const TemplateVectorType<int, 33>::type BadSize = {};
  332. const TemplateVectorType<int, 3200>::type Large = {};
  333. // expected-error@#1 {{vector size too large}}
  334. - // expected-note@+1 {{in instantiation of template class 'Templates::TemplateVectorType<int, 68719476736>' requested here}}
  335. + // expected-note@+1 {{in instantiation of template class 'Templates::TemplateVectorType<int, 68719476736ULL>' requested here}}
  336. const TemplateVectorType<int, 0x1000000000>::type TooLarge = {};
  337. // expected-error@#1 {{zero vector size}}
  338. - // expected-note@+1 {{in instantiation of template class 'Templates::TemplateVectorType<int, 0>' requested here}}
  339. + // expected-note@+1 {{in instantiation of template class 'Templates::TemplateVectorType<int, 0ULL>' requested here}}
  340. const TemplateVectorType<int, 0>::type Zero = {};
  341.  
  342. // expected-error@#2 {{vector size too large}}
  343. diff --git a/clang/test/SemaTemplate/address_space-dependent.cpp b/clang/test/SemaTemplate/address_space-dependent.cpp
  344. index bab6ca5d7b3..dff49cf5b1f 100644
  345. --- a/clang/test/SemaTemplate/address_space-dependent.cpp
  346. +++ b/clang/test/SemaTemplate/address_space-dependent.cpp
  347. @@ -84,8 +84,8 @@ template <unsigned A> int __attribute__((address_space(A))) *same_template();
  348. template <unsigned B> int __attribute__((address_space(B))) *same_template();
  349. void test_same_template() { (void) same_template<0>(); }
  350.  
  351. -template <unsigned A> int __attribute__((address_space(A))) *different_template(); // expected-note {{candidate function [with A = 0]}}
  352. -template <unsigned B> int __attribute__((address_space(B+1))) *different_template(); // expected-note {{candidate function [with B = 0]}}
  353. +template <unsigned A> int __attribute__((address_space(A))) *different_template(); // expected-note {{candidate function [with A = 0U]}}
  354. +template <unsigned B> int __attribute__((address_space(B+1))) *different_template(); // expected-note {{candidate function [with B = 0U]}}
  355. void test_different_template() { (void) different_template<0>(); } // expected-error {{call to 'different_template' is ambiguous}}
  356.  
  357. template <typename T> struct partial_spec_deduce_as;
  358. @@ -102,7 +102,7 @@ int main() {
  359. HasASTemplateFields<1> HASTF;
  360. neg<-1>(); // expected-note {{in instantiation of function template specialization 'neg<-1>' requested here}}
  361. correct<0x7FFFF3>();
  362. - tooBig<8388650>(); // expected-note {{in instantiation of function template specialization 'tooBig<8388650>' requested here}}
  363. + tooBig<8388650>(); // expected-note {{in instantiation of function template specialization 'tooBig<8388650L>' requested here}}
  364.  
  365. __attribute__((address_space(1))) char *x;
  366. __attribute__((address_space(2))) char *y;
  367. diff --git a/clang/test/SemaTemplate/delegating-constructors.cpp b/clang/test/SemaTemplate/delegating-constructors.cpp
  368. index 852b89d809f..db3939d9b0e 100644
  369. --- a/clang/test/SemaTemplate/delegating-constructors.cpp
  370. +++ b/clang/test/SemaTemplate/delegating-constructors.cpp
  371. @@ -9,7 +9,7 @@ namespace PR10457 {
  372. public:
  373. template <unsigned N>
  374. string(const char (&str)[N])
  375. - : string(str) {} // expected-error{{constructor for 'string<6>' creates a delegation cycle}}
  376. + : string(str) {} // expected-error{{constructor for 'string<6U>' creates a delegation cycle}}
  377. };
  378.  
  379. void f() {
  380. diff --git a/clang/test/SemaTemplate/dependent-names.cpp b/clang/test/SemaTemplate/dependent-names.cpp
  381. index a8de159a1d4..b32e2caa17a 100644
  382. --- a/clang/test/SemaTemplate/dependent-names.cpp
  383. +++ b/clang/test/SemaTemplate/dependent-names.cpp
  384. @@ -338,7 +338,7 @@ template < unsigned > struct X {
  385. struct Y: Y<dim> { }; // expected-error{{circular inheritance between 'Y<dim>' and 'Y<dim>'}}
  386. };
  387. typedef X<3> X3;
  388. -X3::Y<>::iterator it; // expected-error {{no type named 'iterator' in 'PR11421::X<3>::Y<3>'}}
  389. +X3::Y<>::iterator it; // expected-error {{no type named 'iterator' in 'PR11421::X<3U>::Y<3U>'}}
  390. }
  391.  
  392. namespace rdar12629723 {
  393. diff --git a/clang/test/SemaTemplate/matrix-type.cpp b/clang/test/SemaTemplate/matrix-type.cpp
  394. index 0ced57c71aa..8d0c5bae801 100644
  395. --- a/clang/test/SemaTemplate/matrix-type.cpp
  396. +++ b/clang/test/SemaTemplate/matrix-type.cpp
  397. @@ -17,7 +17,7 @@ void matrix_template_3() {
  398.  
  399. void instantiate_template_3() {
  400. matrix_template_3<1, 10>();
  401. - matrix_template_3<0, 10>(); // expected-note{{in instantiation of function template specialization 'matrix_template_3<0, 10>' requested here}}
  402. + matrix_template_3<0, 10>(); // expected-note{{in instantiation of function template specialization 'matrix_template_3<0U, 10U>' requested here}}
  403. }
  404.  
  405. template <int Rows, unsigned Cols>
  406. @@ -27,7 +27,7 @@ void matrix_template_4() {
  407.  
  408. void instantiate_template_4() {
  409. matrix_template_4<2, 10>();
  410. - matrix_template_4<-3, 10>(); // expected-note{{in instantiation of function template specialization 'matrix_template_4<-3, 10>' requested here}}
  411. + matrix_template_4<-3, 10>(); // expected-note{{in instantiation of function template specialization 'matrix_template_4<-3, 10U>' requested here}}
  412. }
  413.  
  414. template <class T, unsigned long R, unsigned long C>
  415. @@ -35,11 +35,11 @@ using matrix = T __attribute__((matrix_type(R, C)));
  416.  
  417. template <class T, unsigned long R>
  418. void use_matrix(matrix<T, R, 10> &m) {}
  419. -// expected-note@-1 {{candidate function [with T = float, R = 10]}}
  420. +// expected-note@-1 {{candidate function [with T = float, R = 10UL]}}
  421.  
  422. template <class T, unsigned long C>
  423. void use_matrix(matrix<T, 10, C> &m) {}
  424. -// expected-note@-1 {{candidate function [with T = float, C = 10]}}
  425. +// expected-note@-1 {{candidate function [with T = float, C = 10UL]}}
  426.  
  427. void test_ambigous_deduction1() {
  428. matrix<float, 10, 10> m;
  429. @@ -64,17 +64,17 @@ matrix<float, R + 1, C + 2> use_matrix_2(matrix<int, R, C> &m) {}
  430.  
  431. template <unsigned long R, unsigned long C>
  432. void use_matrix_2(matrix<int, R + 2, C / 2> &m1, matrix<float, R, C> &m2) {}
  433. -// expected-note@-1 {{candidate function [with R = 3, C = 11] not viable: no known conversion from 'matrix<int, 5, 6>' (aka 'int __attribute__((matrix_type(5, 6)))') to 'matrix<int, 3UL + 2, 11UL / 2> &' (aka 'int __attribute__((matrix_type(5, 5)))&') for 1st argument}}
  434. -// expected-note@-2 {{candidate template ignored: deduced type 'matrix<float, 3UL, 4UL>' of 2nd parameter does not match adjusted type 'matrix<int, 3, 4>' of argument [with R = 3, C = 4]}}
  435. +// expected-note@-1 {{candidate function [with R = 3UL, C = 11UL] not viable: no known conversion from 'matrix<int, 5, 6>' (aka 'int __attribute__((matrix_type(5, 6)))') to 'matrix<int, 3UL + 2, 11UL / 2> &' (aka 'int __attribute__((matrix_type(5, 5)))&') for 1st argument}}
  436. +// expected-note@-2 {{candidate template ignored: deduced type 'matrix<float, 3UL, 4UL>' of 2nd parameter does not match adjusted type 'matrix<int, 3, 4>' of argument [with R = 3UL, C = 4UL]}}
  437.  
  438. template <typename T, unsigned long R, unsigned long C>
  439. void use_matrix_2(matrix<T, R + C, C> &m1, matrix<T, R, C - R> &m2) {}
  440. // expected-note@-1 {{candidate template ignored: deduced conflicting types for parameter 'T' ('int' vs. 'float')}}
  441. -// expected-note@-2 {{candidate template ignored: deduced type 'matrix<[...], 3UL + 4UL, 4UL>' of 1st parameter does not match adjusted type 'matrix<[...], 3, 4>' of argument [with T = int, R = 3, C = 4]}}
  442. +// expected-note@-2 {{candidate template ignored: deduced type 'matrix<[...], 3UL + 4UL, 4UL>' of 1st parameter does not match adjusted type 'matrix<[...], 3, 4>' of argument [with T = int, R = 3UL, C = 4UL]}}
  443.  
  444. template <typename T, unsigned long R>
  445. void use_matrix_3(matrix<T, R - 2, R> &m) {}
  446. -// expected-note@-1 {{candidate template ignored: deduced type 'matrix<[...], 5UL - 2, 5UL>' of 1st parameter does not match adjusted type 'matrix<[...], 5, 5>' of argument [with T = unsigned int, R = 5]}}
  447. +// expected-note@-1 {{candidate template ignored: deduced type 'matrix<[...], 5UL - 2, 5UL>' of 1st parameter does not match adjusted type 'matrix<[...], 5, 5>' of argument [with T = unsigned int, R = 5UL]}}
  448.  
  449. void test_use_matrix_2() {
  450. matrix<int, 5, 6> m1;
  451. diff --git a/clang/test/SemaTemplate/temp_arg_nontype.cpp b/clang/test/SemaTemplate/temp_arg_nontype.cpp
  452. index 245b9a60269..b22245e9605 100644
  453. --- a/clang/test/SemaTemplate/temp_arg_nontype.cpp
  454. +++ b/clang/test/SemaTemplate/temp_arg_nontype.cpp
  455. @@ -270,6 +270,24 @@ namespace PR9227 {
  456. void test_char_possibly_negative() { enable_if_char<'\x02'>::type i; } // expected-error{{enable_if_char<'\x02'>'; did you mean 'enable_if_char<'a'>::type'?}}
  457. void test_char_single_quote() { enable_if_char<'\''>::type i; } // expected-error{{enable_if_char<'\''>'; did you mean 'enable_if_char<'a'>::type'?}}
  458. void test_char_backslash() { enable_if_char<'\\'>::type i; } // expected-error{{enable_if_char<'\\'>'; did you mean 'enable_if_char<'a'>::type'?}}
  459. +
  460. + template <int N> struct enable_if_int {};
  461. + template <> struct enable_if_int<1> { typedef int type; }; // expected-note{{'enable_if_int<1>::type' declared here}}
  462. + void test_int() { enable_if_int<2>::type i; } // expected-error{{enable_if_int<2>'; did you mean 'enable_if_int<1>::type'?}}
  463. +
  464. + template <unsigned int N> struct enable_if_unsigned_int {};
  465. + template <> struct enable_if_unsigned_int<1> { typedef int type; }; // expected-note{{'enable_if_unsigned_int<1>::type' declared here}}
  466. + void test_unsigned_int() { enable_if_unsigned_int<2>::type i; } // expected-error{{enable_if_unsigned_int<2U>'; did you mean 'enable_if_unsigned_int<1>::type'?}}
  467. +
  468. +
  469. + template <unsigned long long N> struct enable_if_unsigned_long_long {};
  470. + template <> struct enable_if_unsigned_long_long<1> { typedef int type; }; // expected-note{{'enable_if_unsigned_long_long<1>::type' declared here}}
  471. + void test_unsigned_long_long() { enable_if_unsigned_long_long<2>::type i; } // expected-error{{enable_if_unsigned_long_long<2ULL>'; did you mean 'enable_if_unsigned_long_long<1>::type'?}}
  472. +
  473. + template <long long N> struct enable_if_long_long {};
  474. + template <> struct enable_if_long_long<1> { typedef int type; }; // expected-note{{'enable_if_long_long<1>::type' declared here}}
  475. + void test_long_long() { enable_if_long_long<2>::type i; } // expected-error{{enable_if_long_long<2LL>'; did you mean 'enable_if_long_long<1>::type'?}}
  476. +
  477. }
  478.  
  479. namespace PR10579 {
Add Comment
Please, Sign In to add comment