Page MenuHomePhabricator

[MSVC] Fix check for wchar_t type in case of -fno-wchar

Authored by DmitryPolukhin on Apr 13 2016, 5:16 AM.



The example below should work identically with and without compiler native wchar_t support.

void foo(wchar_t * t = L"");

Diff Detail


Event Timeline

DmitryPolukhin retitled this revision from to [MSVC] Fix check for wchar_t type in case of -fno-wchar.
DmitryPolukhin updated this object.
DmitryPolukhin added a reviewer: rnk.
DmitryPolukhin added a subscriber: cfe-commits.
rnk accepted this revision.Apr 13 2016, 10:31 AM
rnk edited edge metadata.


12 ↗(On Diff #53542)

Can you add some negative tests like these:

short *p1 = L""; // error
int *p2 = L""; // error

Even if they don't make it into IsStringLiteralToNonConstPointerConversion, it's nice to test around things a bit.

This revision is now accepted and ready to land.Apr 13 2016, 10:31 AM
This revision was automatically updated to reflect the committed changes.
DmitryPolukhin marked an inline comment as done.Apr 14 2016, 2:58 AM

I added few more negative tests. Thank you for the review!