This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/48224] ERROR: compile in g++ version 4.5
- From: "evgenij.fokin at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 22 Mar 2011 09:38:41 +0000
- Subject: [Bug c++/48224] ERROR: compile in g++ version 4.5
- Auto-submitted: auto-generated
- References: <bug-48224-4@http.gcc.gnu.org/bugzilla/>
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?