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++/48224] ERROR: compile in g++ version 4.5


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

Evgenij <evgenij.fokin at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |

--- Comment #3 from Evgenij <evgenij.fokin at gmail dot com> 2011-03-22 09:38:34 UTC ---
Andrew, your code works fine. But this example can show another problem.

Remove setter from code and change return type for getter.

#include <map>

struct structure;

typedef std::map<int, structure> mapOfStructure;

class simpleClass
{
    mapOfStructure m_mos;
    const mapOfStructure GetMos () const { return m_mos; }
};

struct structure
{
    int i;
};

--- CUT ---
Getter returns incomplete type but no compile error.
Why the getter compiles without error and the setter compiles with error?


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