Using functions with attribute error/warning from templates doesn't output the instantiation stack. With attribute deprecated this works.
Consider this program: ///////////////////////////////////////////////////////////////// void func() __attribute__ ((error("error"))); //void func() __attribute__ ((warning("warning"))); //void func() __attribute__ ((deprecated)); void func() {} template<class T> void bar() { func(); } int main( int, char** ) { bar<int>(); } ///////////////////////////////////////////////////////////////// With attribute error: t.cc: In function 'void bar() [with T = int]': t.cc:11: error: call to 'func' declared with attribute error: error With attribute deprecated: t.cc: In function 'void bar() [with T = int]': t.cc:16: instantiated from here t.cc:11: warning: 'void func()' is deprecated (declared at t.cc:5) -- Summary: attribute error and warning dont show the instantiation stack Product: gcc Version: 4.4.1 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: joerg dot richter at pdv-fs dot de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41373