This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/47461] New: warn_unused_result attribute ignored for templates


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: unassigned@gcc.gnu.org
        ReportedBy: ian@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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]