50 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only %s -std=c++26 -verify=expected,notree2// RUN: %clang_cc1 -fsyntax-only %s -std=c++26 -fno-elide-type -verify=expected,notree3// RUN: %clang_cc1 -fsyntax-only %s -std=c++26 -fdiagnostics-show-template-tree -verify=expected,tree4// RUN: %clang_cc1 -fsyntax-only %s -std=c++26 -fno-elide-type -fdiagnostics-show-template-tree -verify=expected,tree5 6namespace GH93068 {7 int n[2];8 9 template <auto> struct A {}; // #A10 11 namespace t1 {12 // notree-error@#1 {{no viable conversion from 'A<0>' to 'A<n + 1>'}}13 14 /* tree-error@#1 {{no viable conversion15 A<16 [0 != n + 1]>}}*/17 18 A<n + 1> v1 = A<0>(); // #119 // 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}}21 22 // notree-error@#2 {{no viable conversion from 'A<n>' to 'A<n + 1>'}}23 /* tree-error@#2 {{no viable conversion24 A<25 [n != n + 1]>}}*/26 27 A<n + 1> v2 = A<n>(); // #228 // 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 t131 32 namespace t2 {33 A<n> v1;34 A<n + 1> v2;35 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}}38 39 /* tree-note@#A {{no known conversion from argument type to parameter type for 1st argument40 [(no qualifiers) != const] A<41 [n != (no argument)]>}}*/42 43 /* tree-note@#A {{no known conversion from argument type to parameter type for 1st argument44 A<45 [n != (no argument)]>}}*/46 47 void f() { v2 = v1; } // expected-error {{no viable overloaded '='}}48 } // namespace t249} // namespace GH9306850