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

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-03-23 10:37:40 UTC ---
(In reply to comment #7)
> Jonathan, I disagree with you.

You're welcome to disagree, but you're wrong ;)

In your original example the compiler tells you where the template is
instantiated:
compileError.hxx:11:62:   instantiated from here

At that point the type is incomplete.

The example in comment 3 is also undefined, but compiles anyway. That doesn't
make it correct. As I said, undefined means it might work, it might not, you
can't rely on any specific behaviour.

Compiling with -D_GLIBCXX_CONCEPT_CHECKS turns on C++03 concept checking, which
tells you the problem: the concept checks fail for the code in comment 3
because the incomplete type does not meet the requirements of Assignable types
(required by 23.1p3 [lib.containers.requirements] in C++03).  Without concept
checks it compiles OK because you don't do an assignment.  In your original
example you do an assignment on line 11, which is the point of instantiation
that requires 'structure' to be complete.


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