[ObjC] Improve error message for a malformed objc-type-name
If the type didn't exist, we used to emit a really bad error:
t.m:3:12: error: expected ')'
-(nullable NoSuchType)foo3;
^
rdar://50925632
llvm-svn: 364489
diff --git a/clang/lib/Parse/ParseObjc.cpp b/clang/lib/Parse/ParseObjc.cpp
index c2e73d5..a8d6f7f 100644
--- a/clang/lib/Parse/ParseObjc.cpp
+++ b/clang/lib/Parse/ParseObjc.cpp
@@ -1247,11 +1247,11 @@
BalancedDelimiterTracker T(*this, tok::l_paren);
T.consumeOpen();
- SourceLocation TypeStartLoc = Tok.getLocation();
ObjCDeclContextSwitch ObjCDC(*this);
// Parse type qualifiers, in, inout, etc.
ParseObjCTypeQualifierList(DS, context);
+ SourceLocation TypeStartLoc = Tok.getLocation();
ParsedType Ty;
if (isTypeSpecifierQualifier() || isObjCInstancetype()) {