[cfe-dev] [BUG] -Wunreachable-code not working

Martin Galvan via cfe-dev cfe-dev at lists.llvm.org
Fri Apr 6 12:41:48 PDT 2018


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.


More information about the cfe-dev mailing list