summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/new.cpp
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
commit3bdcff5866f812c7f3425362a0af878faf64d4b3 (patch)
tree64c0dc60d41d3d1e9433c716d976497b03756383 /clang/test/CodeGenCXX/new.cpp
parent4cc3f296a9076457b9f35c5a7403e05cf1217d69 (diff)
downloadbcm5719-llvm-3bdcff5866f812c7f3425362a0af878faf64d4b3.tar.gz
bcm5719-llvm-3bdcff5866f812c7f3425362a0af878faf64d4b3.zip
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. llvm-svn: 133913
Diffstat (limited to 'clang/test/CodeGenCXX/new.cpp')
-rw-r--r--clang/test/CodeGenCXX/new.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/new.cpp b/clang/test/CodeGenCXX/new.cpp
index d14a5e251ce..bd307f10867 100644
--- a/clang/test/CodeGenCXX/new.cpp
+++ b/clang/test/CodeGenCXX/new.cpp
@@ -209,3 +209,16 @@ namespace test15 {
new (p) A[n];
}
}
+
+namespace PR10197 {
+ // CHECK: define weak_odr void @_ZN7PR101971fIiEEvv()
+ template<typename T>
+ void f() {
+ // CHECK: [[CALL:%.*]] = call noalias i8* @_Znwm
+ // CHECK-NEXT: [[CASTED:%.*]] = bitcast i8* [[CALL]] to
+ new T;
+ // CHECK-NEXT: ret void
+ }
+
+ template void f<int>();
+}
OpenPOWER on IntegriCloud