-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Correctly diagnose incomplete arrays with static storage in C #134374
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,16 +3,15 @@ | |
|
|
||
|
|
||
|
|
||
| struct foo; // c-note 5 {{forward declaration of 'struct foo'}} \ | ||
| struct foo; // c-note 4 {{forward declaration of 'struct foo'}} \ | ||
| cxx-note 3 {{forward declaration of 'foo'}} | ||
|
|
||
| void b; // expected-error {{variable has incomplete type 'void'}} | ||
| struct foo f; // c-error {{tentative definition has type 'struct foo' that is never completed}} \ | ||
| cxx-error {{variable has incomplete type 'struct foo'}} | ||
|
|
||
| static void c; // expected-error {{variable has incomplete type 'void'}} | ||
| static struct foo g; // c-warning {{tentative definition of variable with internal linkage has incomplete non-array type 'struct foo'}} \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did this one disappear?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because the diagnostic went from |
||
| c-error {{tentative definition has type 'struct foo' that is never completed}} \ | ||
| static struct foo g; // c-error {{tentative definition has type 'struct foo' that is never completed}} \ | ||
| cxx-error {{variable has incomplete type 'struct foo'}} | ||
|
|
||
| extern void d; // cxx-error {{variable has incomplete type 'void'}} | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.