Skip to content

Commit

Permalink
Improve diagnostic wording
Browse files Browse the repository at this point in the history
  • Loading branch information
ahatanak committed Jul 17, 2024
1 parent 0f18a7a commit 0fcd6d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion clang/include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -6018,7 +6018,7 @@ def note_extern_c_global_conflict : Note<
def note_extern_c_begins_here : Note<
"extern \"C\" language linkage specification begins here">;
def warn_weak_import : Warning <
"an already-defined variable is made a weak_import declaration %0">;
"%0 cannot be declared 'weak_import' because its definition has been provided">;
def ext_static_non_static : Extension<
"redeclaring non-static %0 as static is a Microsoft extension">,
InGroup<MicrosoftRedeclareStatic>;
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Sema/attr-weak.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ static int f(void) __attribute__((weak)); // expected-error {{weak declaration c
static int x __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}

int C; // expected-note {{previous definition is here}}
extern int C __attribute__((weak_import)); // expected-warning {{an already-defined variable is made a weak_import declaration}}
extern int C __attribute__((weak_import)); // expected-warning {{'C' cannot be declared 'weak_import'}}

int C2; // expected-note {{previous definition is here}}
extern int C2;
extern int C2 __attribute__((weak_import)); // expected-warning {{an already-defined variable is made a weak_import declaration}}
extern int C2 __attribute__((weak_import)); // expected-warning {{'C2' cannot be declared 'weak_import'}}

static int pr14946_x;
extern int pr14946_x __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}
Expand Down

0 comments on commit 0fcd6d8

Please sign in to comment.