summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2018-11-19 20:10:21 +0000
committerVedant Kumar <vsk@apple.com>2018-11-19 20:10:21 +0000
commitc9a9531a035a07fdc2d63d9f4caf73ec4c44775d (patch)
tree5e4197fdd24f989f8a21836ae8d44802b5fafbb1 /clang/lib
parentfdd9b4fc8f698ce49f01753d27548622dfdfcd31 (diff)
downloadbcm5719-llvm-c9a9531a035a07fdc2d63d9f4caf73ec4c44775d.tar.gz
bcm5719-llvm-c9a9531a035a07fdc2d63d9f4caf73ec4c44775d.zip
[Sema] Fix PR38987: keep end location of a direct initializer list
If PerformConstructorInitialization of a direct initializer list constructor is called while instantiating a template, it has brace locations in its BraceLoc arguments but not in the Kind argument. This reverts the hunk https://reviews.llvm.org/D41921#inline-468844. Patch by Orivej Desh! Differential Revision: https://reviews.llvm.org/D53231 llvm-svn: 347261
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaInit.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp
index 80431a63b83..3184be80386 100644
--- a/clang/lib/Sema/SemaInit.cpp
+++ b/clang/lib/Sema/SemaInit.cpp
@@ -6186,7 +6186,10 @@ PerformConstructorInitialization(Sema &S,
TypeSourceInfo *TSInfo = Entity.getTypeSourceInfo();
if (!TSInfo)
TSInfo = S.Context.getTrivialTypeSourceInfo(Entity.getType(), Loc);
- SourceRange ParenOrBraceRange = Kind.getParenOrBraceRange();
+ SourceRange ParenOrBraceRange =
+ (Kind.getKind() == InitializationKind::IK_DirectList)
+ ? SourceRange(LBraceLoc, RBraceLoc)
+ : Kind.getParenOrBraceRange();
if (auto *Shadow = dyn_cast<ConstructorUsingShadowDecl>(
Step.Function.FoundDecl.getDecl())) {
OpenPOWER on IntegriCloud