From a2b47ea624df8f29cf8308ac937d47e378e43697 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 4 Oct 2018 05:57:58 -0400 Subject: [PATCH 07/42] FIXME: reinstate g++.dg/warn/Wformat-pr68052.C --- gcc/testsuite/g++.dg/warn/Wformat-pr68052.C | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 gcc/testsuite/g++.dg/warn/Wformat-pr68052.C diff --git a/gcc/testsuite/g++.dg/warn/Wformat-pr68052.C b/gcc/testsuite/g++.dg/warn/Wformat-pr68052.C new file mode 100644 index 0000000..b9de21d --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wformat-pr68052.C @@ -0,0 +1,29 @@ +// { dg-options "-Wformat -fdiagnostics-show-caret" } + +#define MY_PRINTF(x, ...) __builtin_printf(x, ## __VA_ARGS__) + +int main(void) { + long long ll = 0; + MY_PRINTF("before %ld after", ll); // { dg-line format_string } + // { dg-warning "argument 2 has type 'long long int'" "" { target *-*-* } .-1 } + // TODO: ideally we would underline within the format string here: + /* { dg-begin-multiline-output "" } + MY_PRINTF("before %ld after", ll); + ^~~~~~~~~~~~~~~~~~ ~~ + | + long long int + { dg-end-multiline-output "" } */ + /* { dg-begin-multiline-output "" } + #define MY_PRINTF(x, ...) __builtin_printf(x, ## __VA_ARGS__) + ^ + { dg-end-multiline-output "" } */ + // { dg-message "format string is defined here" "" { target *-*-* } format_string } + /* { dg-begin-multiline-output "" } + MY_PRINTF("before %ld after", ll); + ~~^ + | + long int + %lld + { dg-end-multiline-output "" } */ + return 0; +} -- 1.8.5.3