https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77542
Bug ID: 77542 Summary: __attribute__((warn_unused_result)) ignored on function template Product: gcc Version: 5.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: afenkart at gmail dot com Target Milestone: --- .. template <typename... Args> ReturnValue bind(Args&&... args) __attribute__((warn_unused_result)); .. When ignoring the return value, gcc emits no warning. $ gcc --version gcc (Debian 5.4.0-4) 5.4.0 20160609 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.