This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/61421] Invalid -O2 optimization breaks program
- From: "mimamer at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 05 Jun 2014 21:33:10 +0000
- Subject: [Bug c++/61421] Invalid -O2 optimization breaks program
- Auto-submitted: auto-generated
- References: <bug-61421-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61421
--- Comment #11 from mimamer at gmail dot com ---
In short form,
template<class T> class list2
{
public:
struct node {
T *next;
T *prev;
};
node anchor;
public:
/* API */
}
struct Obj : list2<Obj>::node {
/* obj-specific elements */
}
list2<Obj> main_list;
So, anchor is of type list2<Obj>::node while Obj is derived from
list2<Obj>::node.