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

A [[nonblocking]] destructor can trigger a bogus "missing exception specification" warning #111726

Open
dougsonos opened this issue Oct 9, 2024 · 1 comment
Labels
clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer

Comments

@dougsonos
Copy link
Contributor

dougsonos commented Oct 9, 2024

class Foo {
public:
	Foo();
	
	void bar() [[clang::nonblocking]];
	
	~Foo() [[clang::nonblocking]];
};

void Foo::bar() // no diagnostic
{
}

Foo::~Foo() // error: '~Foo' is missing exception specification 'noexcept'
{
}

Seems to come from Sema::CheckEquivalentExceptionSpec. Something about the function effect being part of the type triggers this.

It's easily worked around by copying the attribute to the destructor's definition.

I can look at this; please assign to me.

@EugeneZelenko EugeneZelenko added clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer and removed new issue labels Oct 9, 2024
@shafik
Copy link
Collaborator

shafik commented Oct 10, 2024

CC @erichkeane

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer
Projects
None yet
Development

No branches or pull requests

3 participants