summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2014-05-02 23:40:32 +0000
committerRichard Trieu <rtrieu@google.com>2014-05-02 23:40:32 +0000
commita1342406f2c5f24a0c510d5e158cce57e8987ae5 (patch)
tree9372632047b838066d38c90f496f35884468ef99 /clang/lib/Parse/ParseDecl.cpp
parentb2faa59976018b9510b7633426b10bab659c8218 (diff)
downloadbcm5719-llvm-a1342406f2c5f24a0c510d5e158cce57e8987ae5.tar.gz
bcm5719-llvm-a1342406f2c5f24a0c510d5e158cce57e8987ae5.zip
Fix PR 19630, don't crash when file ends with whitespace.
llvm-svn: 207883
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 07e606c9864..379beafbcea 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -4834,7 +4834,8 @@ void Parser::ParseDirectDeclarator(Declarator &D) {
LLVM_BUILTIN_TRAP;
if (D.getContext() == Declarator::MemberContext)
Diag(Tok, diag::err_expected_member_name_or_semi)
- << D.getDeclSpec().getSourceRange();
+ << (D.getDeclSpec().isEmpty() ? SourceRange()
+ : D.getDeclSpec().getSourceRange());
else if (getLangOpts().CPlusPlus) {
if (Tok.is(tok::period) || Tok.is(tok::arrow))
Diag(Tok, diag::err_invalid_operator_on_type) << Tok.is(tok::arrow);
OpenPOWER on IntegriCloud