This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/35546] New: __attribute__(format...) broken for membes of template classes?
- From: "duz at sol-3 dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Mar 2008 07:53:11 -0000
- Subject: [Bug c++/35546] New: __attribute__(format...) broken for membes of template classes?
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Source code (no includes needed, no preprocessor involved at all)
------------------------------------------------------------------------
template <int N>
class T
{
void operator() (char const * ...) __attribute__((format(printf,2,3)));
};
template class T<3>;
------------------------------------------------------------------------
This compiles fine with many different gcc versions up to
including gcc-4.2.2 and does not compile with gcc-4.3.
Error messages and details of compiler below.
Regards
Dirk Zoller
gcc-4.3 -v gcc-4.3-bug.cc
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /pub/unpacked/gcc-4.3.0/configure --prefix=/opt/gnu/gcc-4.3.0
--program-suffix=-4.3 --enable-languages=c,c++ --disable-multilib --disable-nls
--disable-shared
Thread model: posix
gcc version 4.3.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-mtune=generic'
/opt/gnu/gcc-4.3.0/libexec/gcc/i686-pc-linux-gnu/4.3.0/cc1plus -quiet -v
-D_GNU_SOURCE gcc-4.3-bug.cc -quiet -dumpbase gcc-4.3-bug.cc -mtune=generic
-auxbase gcc-4.3-bug -version -o /tmp/ccTQ5AXY.s
ignoring nonexistent directory
"/opt/gnu/gcc-4.3.0/lib/gcc/i686-pc-linux-gnu/4.3.0/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/opt/gnu/gcc-4.3.0/lib/gcc/i686-pc-linux-gnu/4.3.0/../../../../include/c++/4.3.0
/opt/gnu/gcc-4.3.0/lib/gcc/i686-pc-linux-gnu/4.3.0/../../../../include/c++/4.3.0/i686-pc-linux-gnu
/opt/gnu/gcc-4.3.0/lib/gcc/i686-pc-linux-gnu/4.3.0/../../../../include/c++/4.3.0/backward
/usr/local/include
/opt/gnu/gcc-4.3.0/include
/opt/gnu/gcc-4.3.0/lib/gcc/i686-pc-linux-gnu/4.3.0/include
/opt/gnu/gcc-4.3.0/lib/gcc/i686-pc-linux-gnu/4.3.0/include-fixed
/usr/include
End of search list.
GNU C++ (GCC) version 4.3.0 (i686-pc-linux-gnu)
compiled by GNU C version 4.3.0, GMP version 4.2.1, MPFR version 2.3.0.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 730a50d5d37a0cefcf09a41ca8133e43
gcc-4.3-bug.cc: In instantiation of 'T<3>':
gcc-4.3-bug.cc:7: instantiated from here
gcc-4.3-bug.cc:4: error: 'printf' was not declared in this scope
gcc-4.3-bug.cc:4: error: unrecognized format specifier
--
Summary: __attribute__(format...) broken for membes of template
classes?
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: duz at sol-3 dot de
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35546