diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-01-25 16:33:23 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-01-25 16:33:23 +0000 |
commit | b988f9cde9bce0848d081b5cd1f6a48b86ec8108 (patch) | |
tree | b8b1eb3a956c328ed205b75ba59d99455974d177 /lib/Parse/ParseDecl.cpp | |
parent | 263b47b6272bfd3ea1c0e61b7ac404e7b2e0f759 (diff) |
Move the type specifier location for elaborated-type-specifiers from
the tag kind (union, struct, class, enum) over to the name of the tag,
if there is a name, since most clients want to point at the name.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94424 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index b5ba8acafc..8cf7a63397 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -1878,10 +1878,12 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS, if (Tok.is(tok::l_brace)) ParseEnumBody(StartLoc, TagDecl); - // TODO: semantic analysis on the declspec for enums. + // FIXME: The DeclSpec should keep the locations of both the keyword and the + // name (if there is one). + SourceLocation TSTLoc = NameLoc.isValid()? NameLoc : StartLoc; const char *PrevSpec = 0; unsigned DiagID; - if (DS.SetTypeSpecType(DeclSpec::TST_enum, StartLoc, PrevSpec, DiagID, + if (DS.SetTypeSpecType(DeclSpec::TST_enum, TSTLoc, PrevSpec, DiagID, TagDecl.getAs<void>(), Owned)) Diag(StartLoc, DiagID) << PrevSpec; } |