diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-09-04 18:29:40 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-09-04 18:29:40 +0000 |
commit | a78c5c34fbd20fde02261c3f3e21933cd58fcc04 (patch) | |
tree | 230c1b5c35c1928705d6c3ac78adc9f4fc18d47b /lib/Parse/ParseExpr.cpp | |
parent | ed032eb5c18b99528cbd76415337b6056a72b911 (diff) |
If a destructor is referenced or a pseudo-destructor expression is
formed without a trailing '(', diagnose the error (these expressions
must be immediately called), emit a fix-it hint, and fix the code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81015 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseExpr.cpp')
-rw-r--r-- | lib/Parse/ParseExpr.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index 8fca14ff98..da923c489d 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -956,7 +956,8 @@ Parser::ParsePostfixExpressionSuffix(OwningExprResult LHS) { OpLoc, OpKind, Tok.getLocation(), Tok.getIdentifierInfo(), - &SS); + SS, + NextToken().is(tok::l_paren)); ConsumeToken(); } else if (getLang().CPlusPlus && Tok.is(tok::kw_operator)) { // We have a reference to a member operator, e.g., t.operator int or |