Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CXX / dcl.decl / dcl.fct.def / dcl.fct.def.general / p8.cpp
blobff5d3dec308321ec90e9d9f2894ae2c93a2860e2
1 // RUN: %clang_cc1 -std=c++11 %s -verify
2 // expected-no-diagnostics
4 using size_t = decltype(sizeof(0));
5 template<typename T> struct check;
6 template<size_t N> struct check<const char[N]> {};
8 constexpr bool startswith(const char *p, const char *q) {
9 return !*q || (*p == *q && startswith(p + 1, q + 1));
11 constexpr bool contains(const char *p, const char *q) {
12 return *p && (startswith(p, q) || contains(p + 1, q));
15 void foo() {
16 check<decltype(__func__)>();
17 static_assert(contains(__func__, "foo"), "");