Patch by Sam McCall, test case by me.
Differential Revision: https://reviews.llvm.org/D25936
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285065
91177308-0d34-0410-b5e6-
96231b3b80d8
def err_os_log_format_not_string_constant : Error<
"os_log() format argument is not a string constant">;
def err_os_log_argument_too_big : Error<
- "os_log() argument %d is too big (%d bytes, max %d)">;
+ "os_log() argument %0 is too big (%1 bytes, max %2)">;
def warn_os_log_format_narg : Error<
"os_log() '%%n' format specifier is not allowed">, DefaultError;
wchar_t wcs[] = {'a', 0};
__builtin_os_log_format(buf, "%S", wcs);
printf("%S", wcs);
+
+ struct { char data[0x100]; } toobig;
+ __builtin_os_log_format(buf, "%s", toobig); // expected-error {{os_log() argument 2 is too big (256 bytes, max 255)}}
}
// Test os_log_format primitive with ObjC string literal format argument.