diff --git a/clang/lib/AST/ByteCode/InterpBuiltin.cpp b/clang/lib/AST/ByteCode/InterpBuiltin.cpp index b788656f9484fc..85cffb0c4332df 100644 --- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp +++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp @@ -243,7 +243,7 @@ static bool interp__builtin_strlen(InterpState &S, CodePtr OpPC, unsigned ID = Func->getBuiltinID(); const Pointer &StrPtr = getParam(Frame, 0); - if (ID == Builtin::BIstrlen || ID == Builtin::BIwcslen) + if (ID == Builtin::BIstrlen) diagnoseNonConstexprBuiltin(S, OpPC, ID); if (!CheckArray(S, OpPC, StrPtr)) @@ -1859,8 +1859,6 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const Function *F, break; case Builtin::BI__builtin_strlen: case Builtin::BIstrlen: - case Builtin::BI__builtin_wcslen: - case Builtin::BIwcslen: if (!interp__builtin_strlen(S, OpPC, Frame, F, Call)) return false; break; diff --git a/clang/test/AST/ByteCode/builtin-functions.cpp b/clang/test/AST/ByteCode/builtin-functions.cpp index b951c04dde5980..f70b77fe74636b 100644 --- a/clang/test/AST/ByteCode/builtin-functions.cpp +++ b/clang/test/AST/ByteCode/builtin-functions.cpp @@ -15,10 +15,6 @@ #error "huh?" #endif -extern "C" { - typedef decltype(sizeof(int)) size_t; - extern size_t wcslen(const wchar_t *p); -} namespace strcmp { constexpr char kFoobar[6] = {'f','o','o','b','a','r'}; @@ -97,14 +93,6 @@ constexpr const char *a = "foo\0quux"; constexpr char d[] = { 'f', 'o', 'o' }; // no nul terminator. constexpr int bad = __builtin_strlen(d); // both-error {{constant expression}} \ // both-note {{one-past-the-end}} - - constexpr int wn = __builtin_wcslen(L"hello"); - static_assert(wn == 5); - constexpr int wm = wcslen(L"hello"); // both-error {{constant expression}} \ - // both-note {{non-constexpr function 'wcslen' cannot be used in a constant expression}} - - int arr[3]; // both-note {{here}} - int wk = arr[wcslen(L"hello")]; // both-warning {{array index 5}} } namespace nan {