Menu

#229 Compiler fails without explanation

None
open
nobody
1
2014-08-28
2014-08-28
Anonymous
No

The bug is caused by this C++ code:

:::C++
#include <iostream>
#include <array>
using namespace std;

struct Foo1
{
    struct init{};
};

struct Foo2 : public Foo1
{
    struct init{};
};

struct Foo3 : public Foo2
{
    struct init{};
};

template <typename... Args>
void Bar(typename Args::init... args)
{
    array<void*, sizeof...(Args) + 2> t = {nullptr, &args..., nullptr};
    for (size_t x = 1; x < sizeof...(Args) + 1; ++x)
        cout << t[x] << endl;
}

int main()
{
    Foo1::init a;
    Foo2::init b;
    Foo3::init c;
    Bar<Foo1, Foo2, Foo3>(a, b, c);
}

I recieve this message when I try to compile:

'
in dependent_type_p, at cp/pt.c:19367
Please submit a full bug report,
with preprocessed source if appropriate.
See http://tdm-gcc.tdragon.net/bugs for instructions.

It is compiled by Code::Blocks 13.12 using gcc version 4.7.1 on Windows XP. The preprocessed file is attached.

1 Attachments

Discussion

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB