public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/35890]  New: __attribute__((format)) fails for methods of template classes
@ 2008-04-09 15:51 zak at transversal dot com
  2008-04-09 15:54 ` [Bug c++/35890] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: zak at transversal dot com @ 2008-04-09 15:51 UTC (permalink / raw)
  To: gcc-bugs

The following code, which compiles cleanly in gcc 4.2.3, produces an error with
4.3.0:

----
template< typename T >
struct X {
        void f(const char *fmt, ...)
        __attribute__((format (printf, 2, 3) ));
};

template class X< void >;
----

fmt_et.cc: In instantiation of 'X<void>':
fmt_et.cc:7:   instantiated from here
fmt_et.cc:4: error: 'printf' was not declared in this scope
fmt_et.cc:4: error: unrecognized format specifier


The error occurs both with explicit instantiation of the class (as above) and
with implicit instantiation via an invocation of the method X<void>::f.  It
does not occur either for a non-template class or if the template is never
instantiated.


-- 
           Summary: __attribute__((format)) fails for methods 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: zak at transversal dot com
 GCC build triplet: x86_64_pc_linux_gnu
  GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64_pc_linux_gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35890


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/35890] __attribute__((format)) fails for methods of template classes
  2008-04-09 15:51 [Bug c++/35890] New: __attribute__((format)) fails for methods of template classes zak at transversal dot com
@ 2008-04-09 15:54 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-04-09 15:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-04-09 15:53 -------


*** This bug has been marked as a duplicate of 35546 ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35890


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-04-09 15:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-09 15:51 [Bug c++/35890] New: __attribute__((format)) fails for methods of template classes zak at transversal dot com
2008-04-09 15:54 ` [Bug c++/35890] " pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).