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

clang: misleading error message when redefining the body of a constructor ctor() = default; #69094

Closed
AbdullahAmrSobh opened this issue Oct 15, 2023 · 0 comments · Fixed by #69688
Labels
clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer enhancement Improving things as opposed to bug fixing, e.g. new or missing feature

Comments

@AbdullahAmrSobh
Copy link

AbdullahAmrSobh commented Oct 15, 2023

Attempting to redefine the CTOR of a class-type which was declared = default, produces the misleading error message error: 'Foo' is missing exception specification 'noexcept'

https://godbolt.org/z/7Tf85cYKG

#include <memory>
struct Foo
{
    Foo() = default;
    float pi;
};
Foo::Foo()
    : pi(3.14)
{
}
@AbdullahAmrSobh AbdullahAmrSobh changed the title Misleading error message when redefining the body of a constructor ctor() = default; clang: misleading error message when redefining the body of a constructor ctor() = default; Oct 15, 2023
@dtcxzyw dtcxzyw added enhancement Improving things as opposed to bug fixing, e.g. new or missing feature clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer and removed new issue labels Oct 15, 2023
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 enhancement Improving things as opposed to bug fixing, e.g. new or missing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants