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

             Bug #: 53725
           Summary: Prototype does not match error if the definition of
                    the ctor is separated from its declaration.
    Classification: Unclassified
           Product: gcc
           Version: 4.6.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: t...@freemail.hu


Created attachment 27657
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27657
Minimal example

In certain conditions if the definition of the ctor separated from its
declaration it generates an compiler error.

I created a minimal example. The original code is from Boost.Move.
Error:
testfull.cpp:16:1: error: prototype for ‘movable::movable(rv<movable>&)’ does
not match any in class ‘movable’
testfull.cpp:5:7: error: candidates are: movable::movable(const movable&)
testfull.cpp:13:5: error:                 movable::movable(rv<movable>&)


If the ctor definition is inside the class the code compiles.

The same can happen with the assignment operator as visible here:
http://lists.boost.org/Archives/boost/2011/07/184263.php

Reply via email to