summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2013-08-15 22:02:56 +0000
committerEli Friedman <eli.friedman@gmail.com>2013-08-15 22:02:56 +0000
commit89fe0d5842469f231c2a0649ff6d88ade892e6e8 (patch)
tree2e2d76928ebf201f5011b76e5c2340e4c01a780a /clang/lib/Sema
parent35b22f69851dee2fb9e17d94ccf26967b5cf3399 (diff)
downloadbcm5719-llvm-89fe0d5842469f231c2a0649ff6d88ade892e6e8.tar.gz
bcm5719-llvm-89fe0d5842469f231c2a0649ff6d88ade892e6e8.zip
Properly track l-paren of a CXXFucntionalCastExpr.
In addition to storing more useful information in the AST, this fixes a semantic check in template instantiation which checks whether the l-paren location is valid. Fixes PR16903. llvm-svn: 188495
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaCast.cpp4
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp5
-rw-r--r--clang/lib/Sema/TreeTransform.h2
3 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaCast.cpp b/clang/lib/Sema/SemaCast.cpp
index 888c14ec392..e3227bcaefe 100644
--- a/clang/lib/Sema/SemaCast.cpp
+++ b/clang/lib/Sema/SemaCast.cpp
@@ -2364,6 +2364,6 @@ ExprResult Sema::BuildCXXFunctionalCastExpr(TypeSourceInfo *CastTypeInfo,
ConstructExpr->setParenRange(SourceRange(LPLoc, RPLoc));
return Op.complete(CXXFunctionalCastExpr::Create(Context, Op.ResultType,
- Op.ValueKind, CastTypeInfo, Op.DestRange.getBegin(),
- Op.Kind, Op.SrcExpr.take(), &Op.BasePath, RPLoc));
+ Op.ValueKind, CastTypeInfo, Op.Kind,
+ Op.SrcExpr.take(), &Op.BasePath, LPLoc, RPLoc));
}
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index ee2eb6d02f6..0b58a3d86d8 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -902,8 +902,9 @@ Sema::BuildCXXTypeConstructExpr(TypeSourceInfo *TInfo,
InitListExpr *List = cast<InitListExpr>(Result.take());
Result = Owned(CXXFunctionalCastExpr::Create(Context, List->getType(),
Expr::getValueKindForType(TInfo->getType()),
- TInfo, TyBeginLoc, CK_NoOp,
- List, /*Path=*/0, RParenLoc));
+ TInfo, CK_NoOp, List,
+ /*Path=*/0,
+ LParenLoc, RParenLoc));
}
// FIXME: Improve AST representation?
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index b3e8720f5e6..9e5738394ea 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -7317,7 +7317,7 @@ TreeTransform<Derived>::TransformCXXFunctionalCastExpr(
return SemaRef.Owned(E);
return getDerived().RebuildCXXFunctionalCastExpr(Type,
- /*FIXME:*/E->getSubExpr()->getLocStart(),
+ E->getLParenLoc(),
SubExpr.get(),
E->getRParenLoc());
}
OpenPOWER on IntegriCloud