Index: lib/Sema/SemaExprCXX.cpp =================================================================== --- lib/Sema/SemaExprCXX.cpp +++ lib/Sema/SemaExprCXX.cpp @@ -3040,7 +3040,8 @@ return (ToPointeeType->getKind() == BuiltinType::Char_U || ToPointeeType->getKind() == BuiltinType::Char_S); case StringLiteral::Wide: - return ToPointeeType->isWideCharType(); + return Context.typesAreCompatible(Context.getWideCharType(), + QualType(ToPointeeType, 0)); } } } Index: test/SemaCXX/no-wchar.cpp =================================================================== --- test/SemaCXX/no-wchar.cpp +++ test/SemaCXX/no-wchar.cpp @@ -7,3 +7,6 @@ void bar() { foo(L"wide string literal"); } + +void foo1(wchar_t * t = L""); +// expected-warning@-1 {{conversion from string literal to 'wchar_t *' (aka 'unsigned short *') is deprecated}}