From: Richard Smith Date: Fri, 23 Aug 2013 02:16:48 +0000 (+0000) Subject: Reword a diagnostic to avoid a confusing implication that it might be talking X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8ef1b372b4a13e79ac827b15635cd0fe08170189;p=clang Reword a diagnostic to avoid a confusing implication that it might be talking about a declaration within a return type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189083 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index dd0c540cbb..17cfce1b95 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -4342,7 +4342,8 @@ def err_member_decl_does_not_match_suggest : Error< "out-of-line %select{declaration|definition}2 of %0 " "does not match any declaration in %1; did you mean %3?">; def err_member_def_does_not_match_ret_type : Error< - "out-of-line definition of %q0 differs from the declaration in the return type">; + "return type of out-of-line definition of %q0 differs from " + "that in the declaration">; def err_nonstatic_member_out_of_line : Error< "non-static data member defined out-of-line">; def err_qualified_typedef_declarator : Error< diff --git a/test/SemaCXX/cxx1y-deduced-return-type.cpp b/test/SemaCXX/cxx1y-deduced-return-type.cpp index e2565e6ea4..26d776f375 100644 --- a/test/SemaCXX/cxx1y-deduced-return-type.cpp +++ b/test/SemaCXX/cxx1y-deduced-return-type.cpp @@ -255,7 +255,7 @@ namespace DefaultedMethods { auto operator=(const A&) = default; // expected-error {{must return 'DefaultedMethods::A &'}} A &operator=(A&&); // expected-note {{previous}} }; - auto A::operator=(A&&) = default; // expected-error {{differs from the declaration in the return type}} + auto A::operator=(A&&) = default; // expected-error {{return type of out-of-line definition of 'DefaultedMethods::A::operator=' differs from that in the declaration}} } namespace Constexpr { diff --git a/test/SemaCXX/nested-name-spec.cpp b/test/SemaCXX/nested-name-spec.cpp index 572e479824..855af93c23 100644 --- a/test/SemaCXX/nested-name-spec.cpp +++ b/test/SemaCXX/nested-name-spec.cpp @@ -261,7 +261,7 @@ namespace PR8159 { namespace rdar7980179 { class A { void f0(); }; // expected-note {{previous}} - int A::f0() {} // expected-error {{out-of-line definition of 'rdar7980179::A::f0' differs from the declaration in the return type}} + int A::f0() {} // expected-error {{return type of out-of-line definition of 'rdar7980179::A::f0' differs}} } namespace alias = A;