diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-01-12 22:41:29 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-01-12 22:41:29 +0000 |
commit | 1d5d0b9df6d2a3df338bc3e63000536406e7666c (patch) | |
tree | 7986c81096111348632c4f5df0cecaae315322c8 /lib/Sema/SemaCXXCast.cpp | |
parent | 9370c8f4af43a98a6f16e65f5d88d58db846e374 (diff) |
Add the location of the right parenthesis of a C++ named cast
(static_cast, dynamic_cast, reinterpret_cast, or const_cast) to
improve source-location information. Fixes PR8960.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123336 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCXXCast.cpp')
-rw-r--r-- | lib/Sema/SemaCXXCast.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Sema/SemaCXXCast.cpp b/lib/Sema/SemaCXXCast.cpp index 37eeac139b..ba1c3b0f40 100644 --- a/lib/Sema/SemaCXXCast.cpp +++ b/lib/Sema/SemaCXXCast.cpp @@ -172,7 +172,8 @@ Sema::BuildCXXNamedCast(SourceLocation OpLoc, tok::TokenKind Kind, CheckConstCast(*this, Ex, DestType, VK, OpRange, DestRange); return Owned(CXXConstCastExpr::Create(Context, DestType.getNonLValueExprType(Context), - VK, Ex, DestTInfo, OpLoc)); + VK, Ex, DestTInfo, OpLoc, + Parens.getEnd())); case tok::kw_dynamic_cast: { CastKind Kind = CK_Dependent; @@ -183,7 +184,7 @@ Sema::BuildCXXNamedCast(SourceLocation OpLoc, tok::TokenKind Kind, return Owned(CXXDynamicCastExpr::Create(Context, DestType.getNonLValueExprType(Context), VK, Kind, Ex, &BasePath, DestTInfo, - OpLoc)); + OpLoc, Parens.getEnd())); } case tok::kw_reinterpret_cast: { CastKind Kind = CK_Dependent; @@ -192,7 +193,7 @@ Sema::BuildCXXNamedCast(SourceLocation OpLoc, tok::TokenKind Kind, return Owned(CXXReinterpretCastExpr::Create(Context, DestType.getNonLValueExprType(Context), VK, Kind, Ex, 0, - DestTInfo, OpLoc)); + DestTInfo, OpLoc, Parens.getEnd())); } case tok::kw_static_cast: { CastKind Kind = CK_Dependent; @@ -203,7 +204,7 @@ Sema::BuildCXXNamedCast(SourceLocation OpLoc, tok::TokenKind Kind, return Owned(CXXStaticCastExpr::Create(Context, DestType.getNonLValueExprType(Context), VK, Kind, Ex, &BasePath, - DestTInfo, OpLoc)); + DestTInfo, OpLoc, Parens.getEnd())); } } |