Skip to content
Commit 6ee1562c authored by Benjamin Kramer's avatar Benjamin Kramer
Browse files

Unify handling of string literal arguments for attributes and add fixits.

This fixes a couple of latent crashes for invalid attributes and also adds a
fixit hint to turn identifiers into string literals if one was expected. It then
proceeds recovery as if the identifier was a literal. Diagnostic locations are
also changed to point at the literal instead of the attribute if the error
concerns the argument. PR17175.

For example:
hidden.c:1:40: error: 'visibility' attribute requires a string
extern int x __attribute__((visibility(hidden)));
                                       ^
                                       "     "
hidden.c:2:29: error: visibility does not match previous declaration
extern int x __attribute__((visibility("default")));
                            ^
hidden.c:1:29: note: previous attribute is here
extern int x __attribute__((visibility(hidden)));
                            ^

llvm-svn: 190699
parent 34bdbbdf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment