diff options
Diffstat (limited to 'test/SemaCXX/attr-format.cpp')
-rw-r--r-- | test/SemaCXX/attr-format.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/SemaCXX/attr-format.cpp b/test/SemaCXX/attr-format.cpp index da134a1..3d5c339 100644 --- a/test/SemaCXX/attr-format.cpp +++ b/test/SemaCXX/attr-format.cpp @@ -14,6 +14,8 @@ struct S { expected-error{{out of bounds}} const char* h3(const char*) __attribute__((format_arg(1))); // \ expected-error{{invalid for the implicit this argument}} + + void operator() (const char*, ...) __attribute__((format(printf, 2, 3))); }; // PR5521 @@ -33,3 +35,9 @@ namespace PR8625 { s.f(str, "%s", str); } } + +// Make sure we interpret member operator calls as having an implicit +// this argument. +void test_operator_call(S s, const char* str) { + s("%s", str); +} |