llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.92k stars 11.52k forks source link

No warning on unused exception parameter with `-Wall -Wextra` #41091

Open MarkZH opened 5 years ago

MarkZH commented 5 years ago
Bugzilla Link 41746
Version 8.0
OS Linux
Attachments Source file demonstrating bug
CC @davidbolvansky,@DougGregor,@zygoloid

Extended Description

~ > cat unused.cpp
int main()
{
    try
    {
        throw 0;
    }
    catch(int k)
    {
    }

    return 0;
}

Compile with: clang++ -Wall -Wextra unused.cpp

No warnings are produced about the unused exception parameter k.

davidbolvansky commented 5 years ago

You can use -Wunused-exception-parameter

But not sure why -Wunused-exception-parameter is not of -Wall / -Wextra ...