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

Namespace inline mismatch diagnostic refers to unhelpful previous definition #50794

Closed
tbaederr opened this issue Aug 12, 2021 · 1 comment
Closed
Assignees
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"

Comments

@tbaederr
Copy link
Contributor

Bugzilla Link 51452
Version trunk
OS Linux
CC @zygoloid

Extended Description

See: https://godbolt.org/z/x87K78TnW

Take this C++ code:

1: inline namespace abc {};
2: namespace abc {};
3: namespace abc {};

Clang will emit a warning for line 2, because the namespace is re-opened as non-inline, while the previous definition was inline. It will add a Note for the previous definition, in this case line 1.

However, it will also emit the same warning for line 3. In this case, it would be helpful to have the Note refer to the definition in line 1, but it instead refers to line 2. That is confusing since the problem is the inline mismatch, but the Note refers to a definition that is not inline.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
@FabianWolff FabianWolff self-assigned this Mar 23, 2022
@FabianWolff
Copy link
Member

Fixed by 528e6eb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"
Projects
None yet
Development

No branches or pull requests

2 participants