http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47461
Summary: warn_unused_result attribute ignored for templates Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: i...@airs.com When I compile this C++ code with current mainline class C { public: template<typename T> bool f(T* m) __attribute__((warn_unused_result)); }; template<typename T> inline bool C::f(T* m) { return true; } void f(C* pc) { int i; pc->f(&i); } I should see a warning for the call to pc->f. However, I see no warnings. I do see a warning for a member function which is not a template.