[Bug c++/16959] gdb hangs in infinite recursion

jmdrouhard at gmail dot com sourceware-bugzilla@sourceware.org
Thu Dec 3 18:47:00 GMT 2015


https://sourceware.org/bugzilla/show_bug.cgi?id=16959

John Drouhard <jmdrouhard at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdrouhard at gmail dot com
            Version|7.6                         |7.10

--- Comment #2 from John Drouhard <jmdrouhard at gmail dot com> ---
I believe this is still an issue in 7.10. I am going to include a different
form of reproduceable than the original report has, and might actually indicate
a different bug. They are strikingly similar, though, so I'll include it here
first.

This form only reproduces the issue when using a typedef as the declared type
for the static member variable. It does NOT exhibit the issue if using the
class type explicitly. Using the typedef becomes desirable when class types
have multiple template parameters. See below:

class A {
    typedef A type;
public:
    bool operator==(const type& other) { return true; }

#ifdef SHOW_BUG
    static const type INSTANCE;
#else
    static const A INSTANCE;
#endif
};

const A A::INSTANCE;

int main() {
    A a;
    if (a == A::INSTANCE) {
        return -1;
    }
    return 0;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list