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++/79502] New: [[nodiscard]] attribute ignored for class template


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79502

            Bug ID: 79502
           Summary: [[nodiscard]] attribute ignored for class template
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lucdanton at free dot fr
  Target Milestone: ---

On r245381, the demonstration program does not complain when compiled.

//------------------------------
template<typename>
struct [[nodiscard]] missiles {};

missiles<void> make() { return {}; }

int main()
{
    // result value ignored here
    make();
}
//------------------------------

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