1 // RUN: %clang_cc1 %s -std=c++11 -fsyntax-only -verify -pedantic
2 
3 # 1 "/usr/include/string.h" 1 3 4
4 extern "C" {
5   typedef decltype(sizeof(int)) size_t;
6   extern size_t strlen(const char *p);
7 }
8 
9 # 10 "SemaCXX/constexpr-strlen.cpp" 2
10 constexpr int n = __builtin_strlen("hello"); // ok
11 constexpr int m = strlen("hello"); // expected-error {{constant expression}} expected-note {{non-constexpr function 'strlen' cannot be used in a constant expression}}
12 
13 // Make sure we can evaluate a call to strlen.
14 int arr[3]; // expected-note {{here}}
15 int k = arr[strlen("hello")]; // expected-warning {{array index 5}}
16