summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-03-06 23:28:18 +0000
committerDouglas Gregor <dgregor@apple.com>2009-03-06 23:28:18 +0000
commitd9f92e2a06a936da71b60c580075cd9acc66cb3f (patch)
tree8d9bd3a394a840f70f15b2bdbe933c5eed254fa1 /clang/lib/Parse/ParseDecl.cpp
parentf77f65ef835db93ea1aa9317512f34120aef9732 (diff)
downloadbcm5719-llvm-d9f92e2a06a936da71b60c580075cd9acc66cb3f.tar.gz
bcm5719-llvm-d9f92e2a06a936da71b60c580075cd9acc66cb3f.zip
Clean up some error messages with anonymous structs/unions and member declaration parsing. Fixes PR3680
llvm-svn: 66305
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 50b6716df8c..bbe074a8fb0 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -1868,7 +1868,10 @@ void Parser::ParseDirectDeclarator(Declarator &D) {
// portion is empty), if an abstract-declarator is allowed.
D.SetIdentifier(0, Tok.getLocation());
} else {
- if (getLang().CPlusPlus)
+ if (D.getContext() == Declarator::MemberContext)
+ Diag(Tok, diag::err_expected_member_name_or_semi)
+ << D.getDeclSpec().getSourceRange();
+ else if (getLang().CPlusPlus)
Diag(Tok, diag::err_expected_unqualified_id);
else
Diag(Tok, diag::err_expected_ident_lparen);
OpenPOWER on IntegriCloud