summaryrefslogtreecommitdiffstats
path: root/clang/test/PCH/cxx-exprs.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-05-06 03:47:15 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-05-06 03:47:15 +0000
commitb9fb121a62de69686dc193d32cba680a1a645277 (patch)
tree5ae91995df8eb4264fd2fa71fe3ef48a8e95d160 /clang/test/PCH/cxx-exprs.cpp
parent9dd6537b3acf98c942cdb020c6ea26d9af309eb3 (diff)
downloadbcm5719-llvm-b9fb121a62de69686dc193d32cba680a1a645277.tar.gz
bcm5719-llvm-b9fb121a62de69686dc193d32cba680a1a645277.zip
[c++20] Implement P1009R2: allow omitting the array bound in an array
new expression. This was voted into C++20 as a defect report resolution, so we retroactively apply it to all prior language modes (though it can never actually be used before C++11 mode). llvm-svn: 360006
Diffstat (limited to 'clang/test/PCH/cxx-exprs.cpp')
-rw-r--r--clang/test/PCH/cxx-exprs.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/PCH/cxx-exprs.cpp b/clang/test/PCH/cxx-exprs.cpp
index b7707e0b934..e02bb0aa056 100644
--- a/clang/test/PCH/cxx-exprs.cpp
+++ b/clang/test/PCH/cxx-exprs.cpp
@@ -20,10 +20,16 @@ public:
}
};
+template<typename ...T> int *arr_new(T ...v) {
+ return new int[]{v...};
+}
+
#else
New<int> *clone_new(New<int> *n) {
return n->clone();
}
+int *use_arr_new = arr_new(1, 2, 3);
+
#endif
OpenPOWER on IntegriCloud