User account creation filtered due to spam.

Bug 35546 - [4.3/4.4 Regression] __attribute__(format...) broken for members of template classes?
Summary: [4.3/4.4 Regression] __attribute__(format...) broken for members of template ...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.2.4
: P1 normal
Target Milestone: 4.3.1
Assignee: Jakub Jelinek
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: rejects-valid
: 35668 35890 36372 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-12 07:53 UTC by duz
Modified: 2008-05-29 15:07 UTC (History)
8 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work: 4.2.2
Known to fail: 4.3.0
Last reconfirmed: 2008-03-25 17:13:04


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description duz 2008-03-12 07:53:10 UTC
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
Comment 1 Richard Biener 2008-03-15 19:13:13 UTC
This was probably broken by the attribute handling on templates changes.
Comment 2 Richard Biener 2008-03-22 18:53:27 UTC
*** Bug 35668 has been marked as a duplicate of this bug. ***
Comment 3 Andrew Pinski 2008-03-24 21:28:04 UTC
CCing Jason as he was the one who did the attribute delaying patches for 4.3.0.
Comment 4 Jakub Jelinek 2008-03-25 17:13:04 UTC
Looking into this.
Comment 5 Jakub Jelinek 2008-03-26 20:35:00 UTC
Subject: Bug 35546

Author: jakub
Date: Wed Mar 26 20:34:14 2008
New Revision: 133615

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133615
Log:
	PR c++/35546
	* pt.c (apply_late_template_attributes): Don't call tsubst on
	first attribute argument if it is IDENTIFIER_NODE.

	* g++.dg/ext/attrib33.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/ext/attrib33.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog

Comment 6 Jakub Jelinek 2008-03-26 20:37:36 UTC
Subject: Bug 35546

Author: jakub
Date: Wed Mar 26 20:36:50 2008
New Revision: 133616

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133616
Log:
	PR c++/35546
	* pt.c (apply_late_template_attributes): Don't call tsubst on
	first attribute argument if it is IDENTIFIER_NODE.

	* g++.dg/ext/attrib33.C: New test.

Added:
    branches/gcc-4_3-branch/gcc/testsuite/g++.dg/ext/attrib33.C
Modified:
    branches/gcc-4_3-branch/gcc/cp/ChangeLog
    branches/gcc-4_3-branch/gcc/cp/pt.c
    branches/gcc-4_3-branch/gcc/testsuite/ChangeLog

Comment 7 Jakub Jelinek 2008-03-27 09:31:01 UTC
Fixed.
Comment 8 Andrew Pinski 2008-04-09 15:53:49 UTC
*** Bug 35890 has been marked as a duplicate of this bug. ***
Comment 9 Andrew Pinski 2008-05-29 15:07:18 UTC
*** Bug 36372 has been marked as a duplicate of this bug. ***