diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-10-08 02:39:23 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-10-08 02:39:23 +0000 |
commit | a6eb5f81d13bacac01faff70a947047725b4413f (patch) | |
tree | bcaa31849ec52affed208d74b4a6cd821785fb06 /lib/Parse/ParseDecl.cpp | |
parent | b4eb64d8426c0eaa58d398961e0e74ff85063d7c (diff) |
When we encounter a '==' in a context expecting a '=', assume the user made a typo:
t.c:1:7: error: invalid '==' at end of declaration; did you mean '='?
int x == 0;
^~
=
Implements rdar://8488464.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116035 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 89b41828b0..e6a4b91e2d 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -594,7 +594,8 @@ Decl *Parser::ParseDeclarationAfterDeclarator(Declarator &D, } // Parse declarator '=' initializer. - if (Tok.is(tok::equal)) { + if (isTokenEqualOrMistypedEqualEqual( + diag::err_invalid_equalequal_after_declarator)) { ConsumeToken(); if (Tok.is(tok::kw_delete)) { SourceLocation DelLoc = ConsumeToken(); |