https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66139

Jaak Ristioja <jaak at ristioja dot ee> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jaak at ristioja dot ee

--- Comment #9 from Jaak Ristioja <jaak at ristioja dot ee> ---
According to a Stack Overflow answer [1] this bug occurs when the constructor
is the first thing executed in the try-block. For example:


#include <iostream>
struct A { A(int e) { throw e; } };

struct B {
    A a{42}; // Same with = 42; syntax
};

int main() {
    try {
        // Remove this printout line to trigger the bug:
        std::cout << "Welcome" << std::endl; 
        B b;
    } catch (int e) {
        return e;
    }
}


  [1]: http://stackoverflow.com/a/43892501/3919155

Reply via email to