[llvm-bugs] [Bug 37117] New: -Wunreachable-code warning not issued when a macro is used

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 12 15:40:28 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37117

            Bug ID: 37117
           Summary: -Wunreachable-code warning not issued when a macro is
                    used
           Product: clang
           Version: 6.0
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: riyaz at synopsys.com
                CC: llvm-bugs at lists.llvm.org

Reported by Martin Galvin on cfe-dev:

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180412/c22bdecc/attachment.html>


More information about the llvm-bugs mailing list