]> granicus.if.org Git - clang/commitdiff
Remove wchar_t* buffer from scanf format fix-it test.
authorJordan Rose <jordan_rose@apple.com>
Thu, 20 Mar 2014 15:54:16 +0000 (15:54 +0000)
committerJordan Rose <jordan_rose@apple.com>
Thu, 20 Mar 2014 15:54:16 +0000 (15:54 +0000)
Amends r204300 to not try to test fixing a wchar_t* to "%ls", which we don't
do correctly anyway. In C mode, wchar_t is just a typedef for a normal
primitive integer type, not a distinct type like it is in C++. To make this
work correctly, we'll need to look for the wchar_t typedef, not just the
builtin type.

Should fix the buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204349 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/format-strings-fixit.c

index 341288366a53d9afda872285cdc93fad8f9bcbdb..b982eb45e5f930aea025d598fbdbc39a594dd2af 100644 (file)
@@ -101,7 +101,6 @@ int scanf(char const *, ...);
 void test2(int intSAParm[static 2]) {
   char str[100];
   char *vstr = "abc";
-  wchar_t wstr[100];
   short shortVar;
   unsigned short uShortVar;
   int intVar;
@@ -124,8 +123,6 @@ void test2(int intSAParm[static 2]) {
   scanf("%lf", str);
   scanf("%lf", vstr);
   scanf("%ls", str);
-  scanf("%f", wstr); // FIXME: wchar_t should resolve to %ls, not %d.
-  scanf("%s", wstr); // FIXME: wchar_t should resolve to %ls, not %d.
   scanf("%ls", str);
 
   // Some integer types.
@@ -225,8 +222,6 @@ void test2(int intSAParm[static 2]) {
 // CHECK: scanf("%99s", str);
 // CHECK: scanf("%s", vstr);
 // CHECK: scanf("%99s", str);
-// CHECK: scanf("{{%d|%hu}}", wstr);
-// CHECK: scanf("{{%d|%hu}}", wstr);
 // CHECK: scanf("%99s", str);
 // CHECK: scanf("%hd", &shortVar);
 // CHECK: scanf("%hu", &uShortVar);