// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused-value -std=c++20 %s namespace GH39811 { template class C {}; C (a); C (b) = C(); C (c) {}; C (((((d))))); template class X; template class Y; void test() { C (g); C (h) = C(); C (i) {}; (void)g; (void)h; (void)i; } C* (bad1); // expected-error {{cannot form pointer to deduced class template specialization type}} C (*bad2); // expected-error {{cannot form pointer to deduced class template specialization type}} } namespace GH64347 { template struct A { X x; Y y;}; void test() { A(1, 2); new A(1, 2); } template void f() { (void)a; } void k() { // Test CTAD works for non-type template arguments. f(); } } // namespace GH64347 namespace GH123591 { template < typename... _Types > struct variant { template variant(_Types...); }; template using AstNode = variant; AstNode tree(42, 43, 44); } namespace GH123591_2 { template using enable_if_t = char; template < typename... Types > struct variant { template < enable_if_t> variant(); }; template using AstNode = variant<>; // expected-note@-1 {{couldn't infer template argument ''}} \ // expected-note@-1 2{{implicit deduction guide declared as}} \ // expected-note@-1 {{candidate function template not viable}} AstNode tree; // expected-error {{no viable constructor or deduction guide}} } namespace GH127539 { template struct A { template A(ArgTs...) {} }; template A(ArgTs...) -> A; template using AA = A; AA a{}; } namespace GH129077 { using size_t = decltype(sizeof(0)); struct index_type { size_t value = 0; index_type() = default; constexpr index_type(size_t i) noexcept : value(i) {} }; template struct extents { constexpr extents(decltype(Extents)...) noexcept {} }; template extents(Extents...) -> extents<(requires { Extents::value; } ? Extents{} : ~0ull)...>; template using index = extents; int main() { extents i{0,0}; auto j = extents<64,{}>({}, 42); index k{0,0}; auto l = index<64,{}>({}, 42); return 0; } } namespace GH129620 { template struct A { constexpr A(Ts...) {} }; template using Foo = A; template using Bar = Foo; Bar a{0, 0}; } namespace GH129998 { struct converible_to_one { constexpr operator int() const noexcept { return 1; } }; template struct class_template { class_template() = default; constexpr class_template(auto&&...) noexcept {} }; template class_template(Extents...) -> class_template<(true ? 0 : +Extents{})...>; template using alias_template = class_template; alias_template var2{converible_to_one{}, 2}; } namespace GH136624 { // expected-note@+1 2{{no known conversion}} template struct A { U t; }; template A(V) -> A; namespace foo { template using Alias = A; } // FIXME: This diagnostic is missing 'foo::Alias', as written. foo::Alias t = 0; // expected-error@-1 {{no viable conversion from 'int' to 'GH136624::A' (aka 'A')}} } // namespace GH136624 namespace GH131342 { template constexpr int val{0}; template struct A { A(T) {} }; template using AA = A>; AA a{0}; } // namespace GH131342