-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"
Description
Bugzilla Link | 10111 |
Resolution | FIXED |
Resolved on | Jun 27, 2011 16:14 |
Version | trunk |
OS | Linux |
Reporter | LLVM Bugzilla Contributor |
CC | @tkremenek |
Extended Description
typedef struct {
char *str;
} Class;
typedef union {
Class *object;
} Instance attribute((transparent_union));
attribute((nonnull(1))) void Class_init(Instance this, char *str) {
this.object->str = str;
}
int main(void) {
Class obj;
Class_init(0, "Hello World");
}
Clang reports: "nonnull attribute only applies to pointer arguments". However, as transparent unions are guaranteed to contain only pointers, using nonnull is safe.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"