summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorSerge Pavlov <sepavloff@gmail.com>2014-01-15 01:53:39 +0000
committerSerge Pavlov <sepavloff@gmail.com>2014-01-15 01:53:39 +0000
commitb620b9d0dbaa826304927178fbfcf91d1d575510 (patch)
tree83c72b6488ae1ff654c745265c47dee8e1dc7720 /clang/lib
parenta19fad7735862b92b02e8a8b1580f499438f7dcd (diff)
downloadbcm5719-llvm-b620b9d0dbaa826304927178fbfcf91d1d575510.tar.gz
bcm5719-llvm-b620b9d0dbaa826304927178fbfcf91d1d575510.zip
Fixed error recovery if sizeof is used without parenthesis
Changes made in r192200 fixed PR16992, which requested fixit suggesting parenthesis if sizeof is followed by type-id. However expression in form T() followed by ')' was incorrectly considered as a type-id if 'T' is typedef name. This change fixes this case. Differential Revision: http://llvm-reviews.chandlerc.com/D2440 llvm-svn: 199284
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Parse/ParseExpr.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp
index d94155ba6c6..f7b0afe60d8 100644
--- a/clang/lib/Parse/ParseExpr.cpp
+++ b/clang/lib/Parse/ParseExpr.cpp
@@ -1492,8 +1492,7 @@ Parser::ParseExprAfterUnaryExprOrTypeTrait(const Token &OpTok,
// pathenthesis around type name.
if (OpTok.is(tok::kw_sizeof) || OpTok.is(tok::kw___alignof) ||
OpTok.is(tok::kw_alignof) || OpTok.is(tok::kw__Alignof)) {
- bool isAmbiguousTypeId;
- if (isTypeIdInParens(isAmbiguousTypeId)) {
+ if (isTypeIdUnambiguously()) {
DeclSpec DS(AttrFactory);
ParseSpecifierQualifierList(DS);
Declarator DeclaratorInfo(DS, Declarator::TypeNameContext);
OpenPOWER on IntegriCloud