Skip to content

[Clang] Update error messages, changed upstream #11023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,9 @@ class RefParamMustBePtrBadPartialU : public RefParamMustBePtrBadPartialBase<int*
template <class V>
class RefParamMustBePtrBadPartialV : public RefParamMustBePtrBadPartialBase<int, int, V> {
public:
int __single ptr2; // expected-error{{'__single' attribute only applies to pointer arguments}}
int __single ptr2; // expected-error{{'__single__' attribute only applies to pointer arguments}}
typeof(RefParamMustBePtrGoodPartialBase<int, int, V>::ptr0) ptr3;
int __single another_method() { return ptr2; } // expected-error{{'__single' attribute only applies to pointer arguments}}
int __single another_method() { return ptr2; } // expected-error{{'__single__' attribute only applies to pointer arguments}}
V __single other; // no error
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct S {
};

void typeofexprs(struct S s) {
// expected-error@+1{{'__single' attribute only applies to pointer arguments}}
// expected-error@+1{{'__single__' attribute only applies to pointer arguments}}
typeof(foo) __single p1;
// expected-error@+1{{initializing 'typeof (foo())' (aka 'char *__single') with an expression of incompatible type 'char * _Nullable' casts away '__unsafe_indexable' qualifier; use '__unsafe_forge_single' or '__unsafe_forge_bidi_indexable' to perform this conversion}}
typeof(foo()) __single p2 = foo();
Expand Down
2 changes: 1 addition & 1 deletion clang/test/BoundsSafety/Sema/terminated-by-attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
void term(int val) {
char a1[__terminated_by(0)] = "";
char a2[__terminated_by(0x40 + 1)] = {'A'};
char a3[__terminated_by(val)] = ""; // expected-error{{'__terminated_by' attribute requires an integer constant}}
char a3[__terminated_by(val)] = ""; // expected-error{{'__terminated_by__' attribute requires an integer constant}}
}

void multiple_attrs(void) {
Expand Down
6 changes: 3 additions & 3 deletions clang/test/BoundsSafety/Sema/unsafe-late-const.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
unsigned global_data_const __unsafe_late_const;
void *global_data_const2 __unsafe_late_const;

// expected-error@+2{{'__unsafe_late_const' attribute only applies to global variables}}
// expected-error@+2{{'__unsafe_late_const' attribute only applies to global variables}}
// expected-error@+2{{'__unsafe_late_const__' attribute only applies to global variables}}
// expected-error@+2{{'__unsafe_late_const__' attribute only applies to global variables}}
void __unsafe_late_const
test(int param __unsafe_late_const) {
static long static_local __unsafe_late_const;
// expected-error@+1{{'__unsafe_late_const' attribute only applies to global variables}}
// expected-error@+1{{'__unsafe_late_const__' attribute only applies to global variables}}
int local __unsafe_late_const;
}
4 changes: 2 additions & 2 deletions clang/test/Frontend/macro_defined_type.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_cc1 -I%S/Inputs -fsyntax-only -verify -triple x86_64-linux-gnu %s
warn-thread-safety-parsing.cpp// RUN: %clang_cc1 -I%S/Inputs -fsyntax-only -verify -triple x86_64-linux-gnu %s

#include <macro_defined_type.h>

Expand Down Expand Up @@ -33,7 +33,7 @@ struct A {
};

struct A_system_macro {
_SYS_LIBCPP_FLOAT_ABI int operator()() throw(); // expected-warning{{'_SYS_LIBCPP_FLOAT_ABI' calling convention is not supported for this target}}
_SYS_LIBCPP_FLOAT_ABI int operator()() throw(); // expected-warning{{'pcs' calling convention is not supported for this target}}
};

// Added test for fix for PR43315
Expand Down
6 changes: 3 additions & 3 deletions clang/test/SemaCXX/warn-thread-safety-parsing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,14 +361,14 @@ int gb_testfn(int y){
}

void gb_function_sys_macro() _SYS_GUARDED_BY(mu1); // \
// expected-warning {{'_SYS_GUARDED_BY' attribute only applies to}}
// expected-warning {{'pcs' attribute only applies to}}

void gb_function_params_sys_macro(int gv_lvar _SYS_GUARDED_BY(mu1)); // \
// expected-warning {{'_SYS_GUARDED_BY' attribute only applies to}}
// expected-warning {{'pcs' attribute only applies to}}

int gb_testfn_sys_macro(int y){
int x _SYS_GUARDED_BY(mu1) = y; // \
// expected-warning {{'_SYS_GUARDED_BY' attribute only applies to}}
// expected-warning {{'pcs' attribute only applies to}}
return x;
}

Expand Down