llvm-for-llvmta/tools/clang/test/SemaCXX/constexpr-factorial.cpp

10 lines
209 B
C++
Raw Normal View History

2022-04-25 13:02:35 +02:00
// 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];