Skip to content

Commit

Permalink
[clang] Reword apologetic Clang diagnostic messages (#76310)
Browse files Browse the repository at this point in the history
Fixes Issue: #61256
  • Loading branch information
pav-code committed Jan 15, 2024
1 parent 3ae8746 commit 24c89bb
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions clang/include/clang/Basic/DiagnosticCommonKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,9 @@ def err_cannot_open_file : Error<"cannot open file '%0': %1">, DefaultFatal;
def err_file_modified : Error<
"file '%0' modified since it was first processed">, DefaultFatal;
def err_file_too_large : Error<
"sorry, unsupported: file '%0' is too large for Clang to process">;
"file '%0' is too large for Clang to process">;
def err_sloc_space_too_large : Error<
"sorry, the translation unit is too large for Clang to process: ran out of source locations">, DefaultFatal;
"translation unit is too large for Clang to process: ran out of source locations">, DefaultFatal;
def err_unsupported_bom : Error<"%0 byte order mark detected in '%1', but "
"encoding is not supported">, DefaultFatal;
def err_unable_to_rename_temp : Error<
Expand Down
10 changes: 5 additions & 5 deletions clang/include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -5145,7 +5145,7 @@ def err_non_type_template_arg_subobject : Error<
def err_non_type_template_arg_addr_label_diff : Error<
"template argument / label address difference / what did you expect?">;
def err_non_type_template_arg_unsupported : Error<
"sorry, non-type template argument of type %0 is not yet supported">;
"non-type template argument of type %0 is not yet supported">;
def err_template_arg_not_convertible : Error<
"non-type template argument of type %0 cannot be converted to a value "
"of type %1">;
Expand Down Expand Up @@ -5198,7 +5198,7 @@ def err_template_arg_not_object_or_func : Error<
def err_template_arg_not_pointer_to_member_form : Error<
"non-type template argument is not a pointer to member constant">;
def err_template_arg_member_ptr_base_derived_not_supported : Error<
"sorry, non-type template argument of pointer-to-member type %1 that refers "
"non-type template argument of pointer-to-member type %1 that refers "
"to member %q0 of a different class is not supported yet">;
def err_template_arg_invalid : Error<
"non-type template argument '%0' is invalid">;
Expand Down Expand Up @@ -9932,10 +9932,10 @@ def warn_new_dangling_initializer_list : Warning<
"will be destroyed at the end of the full-expression">,
InGroup<DanglingInitializerList>;
def warn_unsupported_lifetime_extension : Warning<
"sorry, lifetime extension of "
"lifetime extension of "
"%select{temporary|backing array of initializer list}0 created "
"by aggregate initialization using default member initializer "
"is not supported; lifetime of %select{temporary|backing array}0 "
"by aggregate initialization using a default member initializer "
"is not yet supported; lifetime of %select{temporary|backing array}0 "
"will end at the end of the full-expression">, InGroup<Dangling>;

// For non-floating point, expressions of the form x == x or x != x
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CXX/drs/dr16xx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ namespace dr1696 { // dr1696: 7
const A &a = A(); // #dr1696-D1-a
};
D1 d1 = {}; // #dr1696-d1
// since-cxx14-warning@-1 {{sorry, lifetime extension of temporary created by aggregate initialization using default member initializer is not supported; lifetime of temporary will end at the end of the full-expression}}
// since-cxx14-warning@-1 {{lifetime extension of temporary created by aggregate initialization using a default member initializer is not yet supported; lifetime of temporary will end at the end of the full-expression}}
// since-cxx14-note@#dr1696-D1-a {{initializing field 'a' with default member initializer}}

struct D2 {
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CXX/drs/dr18xx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ namespace dr1815 { // dr1815: no
// FIXME: needs codegen test
struct A { int &&r = 0; }; // #dr1815-A
A a = {};
// since-cxx14-warning@-1 {{sorry, lifetime extension of temporary created by aggregate initialization using default member initializer is not supported; lifetime of temporary will end at the end of the full-expression}} FIXME
// since-cxx14-warning@-1 {{lifetime extension of temporary created by aggregate initialization using a default member initializer is not yet supported; lifetime of temporary will end at the end of the full-expression}} FIXME
// since-cxx14-note@#dr1815-A {{initializing field 'r' with default member initializer}}

struct B { int &&r = 0; }; // #dr1815-B
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Lexer/SourceLocationsOverflow.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: not %clang %s -S -o - 2>&1 | FileCheck %s
// CHECK: In file included from {{.*}}SourceLocationsOverflow.c
// CHECK-NEXT: inc1.h{{.*}}: fatal error: sorry, the translation unit is too large for Clang to process: ran out of source locations
// CHECK-NEXT: inc1.h{{.*}}: fatal error: translation unit is too large for Clang to process: ran out of source locations
// CHECK-NEXT: #include "inc2.h"
// CHECK-NEXT: ^
// CHECK-NEXT: note: 214{{.......}}B in local locations, 0B in locations loaded from AST files, for a total of 214{{.......}}B (99% of available space)
Expand Down
2 changes: 1 addition & 1 deletion clang/test/SemaCXX/constexpr-default-arg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ void test_default_arg2() {
// Check that multiple CXXDefaultInitExprs don't cause an assertion failure.
struct A { int &&r = 0; }; // expected-note 2{{default member initializer}}
struct B { A x, y; };
B b = {}; // expected-warning 2{{not supported}}
B b = {}; // expected-warning 2{{lifetime extension of temporary created by aggregate initialization using a default member initializer is not yet supported}}

}
2 changes: 1 addition & 1 deletion clang/test/SemaCXX/eval-crashes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace pr33140_2 {
// temporaries.
struct A { int &&r = 0; }; // expected-note 2{{initializing field 'r' with default member initializer}}
struct B { A x, y; };
B b = {}; // expected-warning 2{{not supported}}
B b = {}; // expected-warning 2{{lifetime extension of temporary created by aggregate initialization using a default member initializer is not yet supported}}
}

namespace pr33140_3 {
Expand Down
4 changes: 2 additions & 2 deletions clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ namespace Auto {

struct Y : X {};
void type_affects_identity(B<&X::n>) {}
void type_affects_identity(B<(int Y::*)&X::n>) {} // FIXME: expected-error {{sorry}}
void type_affects_identity(B<(int Y::*)&X::n>) {} // FIXME: expected-error {{non-type template argument of pointer-to-member type}}
void type_affects_identity(B<(const int X::*)&X::n>) {}
void type_affects_identity(B<(const int Y::*)&X::n>) {} // FIXME: expected-error {{sorry}}
void type_affects_identity(B<(const int Y::*)&X::n>) {} // FIXME: expected-error {{non-type template argument of pointer-to-member type}}

// A case where we need to do auto-deduction, and check whether the
// resulting dependent types match during partial ordering. These
Expand Down
12 changes: 6 additions & 6 deletions clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ namespace std {

// floating-point arguments
template<float> struct Float {};
using F1 = Float<1.0f>; // FIXME expected-error {{sorry}}
using F1 = Float<2.0f / 2>; // FIXME expected-error {{sorry}}
using F1 = Float<1.0f>; // FIXME expected-error {{non-type template argument of type}}
using F1 = Float<2.0f / 2>; // FIXME expected-error {{non-type template argument of type}}

struct S { int n[3]; } s; // expected-note 1+{{here}}
union U { int a, b; } u;
Expand Down Expand Up @@ -48,12 +48,12 @@ using U1 = Union<U{.b = 1}>; // expected-error {{different types}}

// miscellaneous scalar types
template<_Complex int> struct ComplexInt {};
using CI = ComplexInt<1 + 3i>; // FIXME: expected-error {{sorry}}
using CI = ComplexInt<1 + 3i>; // FIXME: expected-error {{sorry}}
using CI = ComplexInt<1 + 3i>; // FIXME: expected-error {{non-type template argument of type}}
using CI = ComplexInt<1 + 3i>; // FIXME: expected-error {{non-type template argument of type}}

template<_Complex float> struct ComplexFloat {};
using CF = ComplexFloat<1.0f + 3.0fi>; // FIXME: expected-error {{sorry}}
using CF = ComplexFloat<1.0f + 3.0fi>; // FIXME: expected-error {{sorry}}
using CF = ComplexFloat<1.0f + 3.0fi>; // FIXME: expected-error {{non-type template argument of type}}
using CF = ComplexFloat<1.0f + 3.0fi>; // FIXME: expected-error {{non-type template argument of type}}

namespace ClassNTTP {
struct A { // expected-note 2{{candidate}}
Expand Down

0 comments on commit 24c89bb

Please sign in to comment.