// RUN: %clang_cc1 -std=c++1z %s -verify
// The same restrictions apply to the parameter-declaration-clause of a
// deduction guide as in a function declaration.
;
-> ; // expected-note {{previous}}
-> ; // expected-error {{'void' must be the first and only parameter if specified}}
-> ; // expected-error {{redeclaration of deduction guide}}
// expected-note@-1 {{previous}}
-> ; // expected-note {{previous}}
// expected-error@-1 {{redeclaration of deduction guide}}
-> ; // FIXME: "functions" is a poor term. expected-error {{functions that differ only in their return type cannot be overloaded}}
-> ;
-> ; // ok, can overload on return type (SFINAE applies)
-> ;
-> ; // ok, non-template beats template as usual
// (Pending DR) The template-name shall name a class template.
using B = A<T>; // expected-note {{template}}
-> ; // expected-error {{cannot specify deduction guide for alias template 'B'}}
// FIXME: expected-error@-1 {{declarator requires an identifier}}
int C;
-> int; // expected-error {{a type specifier is required}}
void ;
-> int; // expected-error {{a type specifier is required}}
;
-> int; // expected-error {{deduced type 'int' of deduction guide is not a specialization of template 'A'}}
-> ; // expected-error {{deduced type 'B<T>' (aka 'A<type-parameter-0-0>') of deduction guide is not written as a specialization of template 'A'}}
-> const A<T>; // expected-error {{deduced type 'const A<T>' of deduction guide is not a specialization of template 'A'}}
// A deduction-guide shall be declared in the same scope as the corresponding
// class template.