This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/35668] New: [4.3 Regression] printf attribute not recognized in template function
- From: "ian at airs dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Mar 2008 18:48:58 -0000
- Subject: [Bug c++/35668] New: [4.3 Regression] printf attribute not recognized in template function
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This C++ test case works with 4.2 and fails with 4.3.
template<typename T> extern void foo(const char*, ...)
__attribute__ ((__format__ (__printf__, 1, 2)));
template<typename T> void foo(const char* format, ...) {}
void bar() { foo<int>("%s\n", "foo"); }
With 4.3 I get:
foo.cc: In function ?void bar()?:
foo.cc:3: error: ?__printf__? was not declared in this scope
foo.cc:3: error: unrecognized format specifier
--
Summary: [4.3 Regression] printf attribute not recognized in
template function
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ian at airs dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35668