"cannot specify deduction guide for "
"%select{<error>|function template|variable template|alias template|"
"template template parameter|dependent template name}0 %1">;
+def err_deduction_guide_defines_function : Error<
+ "deduction guide cannot have a function definition">;
// C++1y deduced return types
def err_auto_fn_deduction_failure : Error<
// FIXME: Check that the return type can instantiate to a specialization of
// the template specified as the deduction-guide's name.
+
+ if (D.isFunctionDefinition())
+ Diag(D.getIdentifierLoc(), diag::err_deduction_guide_defines_function);
}
//===----------------------------------------------------------------------===//
A(int(&)[30]) const -> A<int>; // expected-error {{deduction guide cannot have 'const' qualifier}}
-// FIXME: No definition is allowed.
-A(int(&)[40]) -> A<int> {}
-A(int(&)[41]) -> A<int> = default; // expected-error {{only special member functions may be defaulted}}
-A(int(&)[42]) -> A<int> = delete;
-A(int(&)[43]) -> A<int> try {} catch (...) {}
+// No definition is allowed.
+A(int(&)[40]) -> A<int> {} // expected-error {{deduction guide cannot have a function definition}}
+A(int(&)[41]) -> A<int> = default; // expected-error {{deduction guide cannot have a function definition}} expected-error {{only special member functions may be defaulted}}
+A(int(&)[42]) -> A<int> = delete; // expected-error {{deduction guide cannot have a function definition}}
+A(int(&)[43]) -> A<int> try {} catch (...) {} // expected-error {{deduction guide cannot have a function definition}}
#ifdef CLASS
};