http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52659

             Bug #: 52659
           Summary: GCC fails to reject a deleted function definition
                    which is not the first declaration
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: illiss...@gmail.com


C++11 8.4.3.4:
"A deleted definition of a function shall be the first declaration of the
function or, for an explicit specialization of a function template, the first
declaration of that specialization. [ Example:
struct sometype {
  sometype();
};
sometype::sometype() = delete; // ill-formed; not first declaration
— end example ]"


$ cat bug.cpp
struct sometype {
  sometype();
};

sometype::sometype() = delete;

$ g++ bug.cpp -std=c++11 -c
$ g++ --version
g++ (GCC) 4.7.0 20120314 (prerelease)
Copyright (C) 2012 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.

Reply via email to