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

redundant error when redefining a function as deleted #13312

Closed
dwblaikie opened this issue May 24, 2012 · 3 comments
Closed

redundant error when redefining a function as deleted #13312

dwblaikie opened this issue May 24, 2012 · 3 comments
Assignees
Labels

Comments

@dwblaikie
Copy link
Collaborator

Bugzilla Link 12940
Resolution FIXED
Resolved on Jul 16, 2012 14:06
Version trunk
OS Linux
CC @DougGregor

Extended Description

Given:

void func() { }
void func() = delete;

Clang produces:

spec.cpp:2:6: error: redefinition of 'func'
void func() = delete;
^
spec.cpp:1:6: note: previous definition is here
void func() { }
^
spec.cpp:2:15: error: deleted definition must be first declaration
void func() = delete;
^
spec.cpp:1:6: note: previous declaration is here
void func() { }
^

Essentially the same diagnostic twice. Either we could simply suppress the second diagnostic when we know the function is already defined (& thus we already produced the first diagnostic), or suppress the first diagnostic when the new definition is deleted and, possibly, make the "deleted definition must be first" diagnostic have some more specific text for this case (based on the same property as the first option: that there's already a definition)

@dwblaikie
Copy link
Collaborator Author

assigned to @dwblaikie

@dwblaikie
Copy link
Collaborator Author

Out for review.

@dwblaikie
Copy link
Collaborator Author

Fixed by r159442

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant