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]

g++ 2.91.66: internal compiler error 40


/* egcs 2.91.66 bug report
 * linux/i386
 *
 * This (wrong) code triggers internal compiler error 40.
 * gcc -c test.cpp
 *
 * Markus F.X.J. Oberhumer <markus.oberhumer@jk.uni-linz.ac.at>
 */


class Foo
{
public:
    bool doSomething(int n);

private:
    struct foo_t {
        unsigned x;
        typedef int (*func_t)(void);
    };
    static const foo_t data[];
};


bool Foo::doSomething(int n)
{
    const foo_t *f = &data[n];
    // the next line is nonsense as func_t is a typedef
    if (f->x == 0 || !f->func_t)
        return false;
    return true;
}



-----   Markus F.X.J. Oberhumer <markus.oberhumer@jk.uni-linz.ac.at>   -----
-----             http://wildsau.idv.uni-linz.ac.at/mfx/               -----
-----        5E CB 5C 85 DE AF 9E BF  E9 DA 7E 6A 39 F8 CC 67          -----

                             3 WARPS TO URANUS


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