Skip to content

Commit e139e68

Browse files
committed
Fix cpp test
1 parent 8bece66 commit e139e68

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/test/SemaCXX/format-strings.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Foo {
3333

3434
int scanf(const char *, ...) __attribute__((format(scanf, 2, 3)));
3535
int printf(const char *, ...) __attribute__((format(printf, 2, 3)));
36-
int printf2(const char *, ...);
36+
int printf2(const char *, ...); // #Foo_printf2
3737

3838
static const char *gettext_static(const char *fmt) __attribute__((format_arg(1)));
3939
static int printf_static(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
@@ -86,8 +86,8 @@ int Foo::printf(const char *fmt, ...) {
8686
int Foo::printf2(const char *fmt, ...) {
8787
va_list ap;
8888
va_start(ap,fmt);
89-
vprintf(fmt, ap); // expected-warning{{format string is not a string literal}}
90-
89+
vprintf(fmt, ap); // expected-warning{{diagnostic behavior may be improved by adding the 'format(printf, 2, 3)' attribute to the declaration of 'printf2'}}
90+
// expected-note@#Foo_printf2 {{'printf2' declared here}}
9191
return 0;
9292
}
9393

0 commit comments

Comments
 (0)