aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/TreeTransform.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-06-27 16:55:54 +0000
committerDouglas Gregor <dgregor@apple.com>2011-06-27 16:55:54 +0000
commitd0e8b782787638bcc9c57022e47c28d3529f02d4 (patch)
tree6d6ca8122f8cc5edd03276009fcd202574bcfc9f /lib/Sema/TreeTransform.h
parent6628969c3e3886b68d8a0051df7e222aa50ef118 (diff)
When instantiating a C++ "new" expression, don't fake source locations
for the '(' and ')' around the initializer unless we actually have an initializer. Fixes PR10197, an issue where we were value-initializing rather than default-initializing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133913 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/TreeTransform.h')
-rw-r--r--lib/Sema/TreeTransform.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h
index 0d923d113a..edbf1fb459 100644
--- a/lib/Sema/TreeTransform.h
+++ b/lib/Sema/TreeTransform.h
@@ -6937,9 +6937,13 @@ TreeTransform<Derived>::TransformCXXNewExpr(CXXNewExpr *E) {
AllocType,
AllocTypeInfo,
ArraySize.get(),
- /*FIXME:*/E->getLocStart(),
+ /*FIXME:*/E->hasInitializer()
+ ? E->getLocStart()
+ : SourceLocation(),
move_arg(ConstructorArgs),
- E->getLocEnd());
+ /*FIXME:*/E->hasInitializer()
+ ? E->getLocEnd()
+ : SourceLocation());
}
template<typename Derived>