Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / Misc / diag-template-diffing-cxx26.cpp
blob2b6dd86a9885dd174b9a4f8dc9cecccba07362b7
1 // RUN: %clang_cc1 -fsyntax-only %s -std=c++26 -verify=expected,notree
2 // RUN: %clang_cc1 -fsyntax-only %s -std=c++26 -fno-elide-type -verify=expected,notree
3 // RUN: %clang_cc1 -fsyntax-only %s -std=c++26 -fdiagnostics-show-template-tree -verify=expected,tree
4 // RUN: %clang_cc1 -fsyntax-only %s -std=c++26 -fno-elide-type -fdiagnostics-show-template-tree -verify=expected,tree
6 namespace GH93068 {
7 int n[2];
9 template <auto> struct A {}; // #A
11 namespace t1 {
12 // notree-error@#1 {{no viable conversion from 'A<0>' to 'A<n + 1>'}}
14 /* tree-error@#1 {{no viable conversion
16 [0 != n + 1]>}}*/
18 A<n + 1> v1 = A<0>(); // #1
19 // expected-note@#A {{no known conversion from 'A<0>' to 'const A<&n[1]> &' for 1st argument}}
20 // expected-note@#A {{no known conversion from 'A<0>' to 'A<&n[1]> &&' for 1st argument}}
22 // notree-error@#2 {{no viable conversion from 'A<n>' to 'A<n + 1>'}}
23 /* tree-error@#2 {{no viable conversion
25 [n != n + 1]>}}*/
27 A<n + 1> v2 = A<n>(); // #2
28 // expected-note@#A {{no known conversion from 'A<n>' to 'const A<&n[1]> &' for 1st argument}}
29 // expected-note@#A {{no known conversion from 'A<n>' to 'A<&n[1]> &&' for 1st argument}}
30 } // namespace t1
32 namespace t2 {
33 A<n> v1;
34 A<n + 1> v2;
36 // notree-note@#A {{no known conversion from 'A<n>' to 'const A<(no argument)>' for 1st argument}}
37 // notree-note@#A {{no known conversion from 'A<n>' to 'A<(no argument)>' for 1st argument}}
39 /* tree-note@#A {{no known conversion from argument type to parameter type for 1st argument
40 [(no qualifiers) != const] A<
41 [n != (no argument)]>}}*/
43 /* tree-note@#A {{no known conversion from argument type to parameter type for 1st argument
45 [n != (no argument)]>}}*/
47 void f() { v2 = v1; } // expected-error {{no viable overloaded '='}}
48 } // namespace t2
49 } // namespace GH93068