Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive bugprone-throw-keyword-missing with NSDMI #115055

Open
carlosgalvezp opened this issue Nov 5, 2024 · 1 comment · May be fixed by #115138
Open

False positive bugprone-throw-keyword-missing with NSDMI #115055

carlosgalvezp opened this issue Nov 5, 2024 · 1 comment · May be fixed by #115138
Assignees
Labels
clang-tidy false-positive Warning fires when it should not

Comments

@carlosgalvezp
Copy link
Contributor

carlosgalvezp commented Nov 5, 2024

Example:

struct RegularException
{
    RegularException(int);
};

class Foo
{
 public:
    Foo(){} 

 private:
    RegularException x_{123};
};

Gives:

[source>:12:24: warning: suspicious exception object created but not thrown; did you mean 'throw RegularException'? [bugprone-throw-keyword-missing]](javascript:;)
   12 |     RegularException x_{123};
      |                        ^

Godbolt

@carlosgalvezp carlosgalvezp added clang-tidy false-positive Warning fires when it should not labels Nov 5, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Nov 5, 2024

@llvm/issue-subscribers-clang-tidy

Author: Carlos Galvez (carlosgalvezp)

Example:
struct RegularException
{
    RegularException(int);
};

class Foo
{
 public:
    Foo(){} 

 private:
    RegularException x_{123};
};

Godbolt

carlosgalvezp pushed a commit to carlosgalvezp/llvm-project that referenced this issue Nov 6, 2024
@carlosgalvezp carlosgalvezp self-assigned this Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang-tidy false-positive Warning fires when it should not
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants