public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/47461] New: warn_unused_result attribute ignored for templates
@ 2011-01-25 16:45 ian at airs dot com
  2011-01-25 16:56 ` [Bug c++/47461] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ian at airs dot com @ 2011-01-25 16:45 UTC (permalink / raw)
  To: gcc-bugs

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.


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

end of thread, other threads:[~2015-08-12 14:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-25 16:45 [Bug c++/47461] New: warn_unused_result attribute ignored for templates ian at airs dot com
2011-01-25 16:56 ` [Bug c++/47461] " redi at gcc dot gnu.org
2015-08-12 14:19 ` paolo.carlini at oracle dot com
2015-08-12 14:49 ` paolo.carlini at oracle dot com

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).