diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-11-08 05:07:16 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-11-08 05:07:16 +0000 |
| commit | 0f0af19b058151690ec02d781d0039fb1fc38426 (patch) | |
| tree | 628729499c9190870f32a30ddfea3d8c9db273fd /clang/test/SemaCXX/cxx0x-compat.cpp | |
| parent | 8f6dd44056ceb2821b7692f1a110f91866b1bf2b (diff) | |
| download | bcm5719-llvm-0f0af19b058151690ec02d781d0039fb1fc38426.tar.gz bcm5719-llvm-0f0af19b058151690ec02d781d0039fb1fc38426.zip | |
[c++1z] N4295: fold-expressions.
This is a new form of expression of the form:
(expr op ... op expr)
where one of the exprs is a parameter pack. It expands into
(expr1 op (expr2onwards op ... op expr))
(and likewise if the pack is on the right). The non-pack operand can be
omitted; in that case, an empty pack gives a fallback value or an error,
depending on the operator.
llvm-svn: 221573
Diffstat (limited to 'clang/test/SemaCXX/cxx0x-compat.cpp')
| -rw-r--r-- | clang/test/SemaCXX/cxx0x-compat.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/cxx0x-compat.cpp b/clang/test/SemaCXX/cxx0x-compat.cpp index ded51ab704b..bcf0cf11dc1 100644 --- a/clang/test/SemaCXX/cxx0x-compat.cpp +++ b/clang/test/SemaCXX/cxx0x-compat.cpp @@ -41,9 +41,15 @@ void h(size_t foo, size_t bar) { #define _x + 1 char c = 'x'_x; // expected-warning {{will be treated as a user-defined literal suffix}} +template<int ...N> int f() { // expected-warning {{C++11 extension}} + return (N + ...); // expected-warning {{C++1z extension}} +} + #else auto init_capture = [a(0)] {}; // expected-warning {{initialized lambda captures are incompatible with C++ standards before C++14}} static_assert(true); // expected-warning {{incompatible with C++ standards before C++1z}} +template<int ...N> int f() { return (N + ...); } // expected-warning {{incompatible with C++ standards before C++1z}} + #endif |

