[BUG] -Wunreachable-code not working

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[BUG] -Wunreachable-code not working

Louis Dionne via cfe-dev
HI all,

I'm reporting this bug here since the LLVM Bugzilla requires
registering an account (which can't be done by myself manually).

Basically, this code triggers the warning:

int main()
{
    return 0;

    int a = 42;
}

while this doesn't:

#define A 42

int main()
{
    return 0;

    int a = A;
}

This happens on clang++-6.0. I'm not using any options other than
-Wunreachable-code.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev