From: Eli Friedman Date: Thu, 18 Jul 2013 23:59:50 +0000 (+0000) Subject: Fix crash-on-invalid with inheriting constructor. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cd37a0b6bbd8d46af116c72537e2129e4a077e5e;p=clang Fix crash-on-invalid with inheriting constructor. Fixes PR16656. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186631 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index bdcccac34c..7bbd25b934 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -3422,7 +3422,7 @@ def err_redefinition : Error<"redefinition of %0">; def err_definition_of_implicitly_declared_member : Error< "definition of implicitly declared %select{default constructor|copy " "constructor|move constructor|copy assignment operator|move assignment " - "operator|destructor}1">; + "operator|destructor|function}1">; def err_definition_of_explicitly_defaulted_member : Error< "definition of explicitly defaulted %select{default constructor|copy " "constructor|move constructor|copy assignment operator|move assignment " diff --git a/test/CXX/special/class.inhctor/p8.cpp b/test/CXX/special/class.inhctor/p8.cpp index 0c857382e3..effc2c3bca 100644 --- a/test/CXX/special/class.inhctor/p8.cpp +++ b/test/CXX/special/class.inhctor/p8.cpp @@ -1,6 +1,5 @@ // RUN: %clang_cc1 -std=c++11 -verify %s -// expected-no-diagnostics struct A { constexpr A(const int&) : rval(false) {} constexpr A(const int&&) : rval(true) {} @@ -28,3 +27,6 @@ struct D : C { using C::C; }; static_assert(D(123).v == 123, ""); + +// FIXME: This diagnostic sucks. +template constexpr D::D(T t) : C(t) {} // expected-error {{definition of implicitly declared function}}