diff options
Diffstat (limited to 'clang/test/SemaCXX/constexpr-factorial.cpp')
-rw-r--r-- | clang/test/SemaCXX/constexpr-factorial.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/constexpr-factorial.cpp b/clang/test/SemaCXX/constexpr-factorial.cpp new file mode 100644 index 0000000..b6cdde5 --- /dev/null +++ b/clang/test/SemaCXX/constexpr-factorial.cpp @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -std=c++11 -fsyntax-only %s + +constexpr unsigned oddfac(unsigned n) { + return n == 1 ? 1 : n * oddfac(n-2); +} +constexpr unsigned k = oddfac(123); + +using A = int[k % 256]; +using A = int[43]; |