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

Fix for readability-redundant-declaration breaks code if linkage specification is used #42068

Closed
igor-akhmetov opened this issue Jul 23, 2019 · 3 comments
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior bugzilla Issues migrated from bugzilla clang-tidy

Comments

@igor-akhmetov
Copy link

Bugzilla Link 42723
Version unspecified
OS Windows NT
CC @EugeneZelenko

Extended Description

Fix for readability-redundant-declaration changes this snippet:

extern "C" int x;
extern "C" int x;

into this:

extern "C" int x;
extern "C"

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
@PiotrZSL PiotrZSL added the bug Indicates an unexpected problem or unintended behavior label Mar 26, 2023
@PiotrZSL
Copy link
Member

Reproduced on main (LLVM 17).

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 26, 2023

@llvm/issue-subscribers-bug

@PiotrZSL PiotrZSL self-assigned this Mar 26, 2023
@PiotrZSL
Copy link
Member

@PiotrZSL PiotrZSL added the awaiting-review Has pending Phabricator review label Mar 26, 2023
@github-actions github-actions bot removed the awaiting-review Has pending Phabricator review label Apr 8, 2023
gysit pushed a commit to nextsilicon/llvm-project that referenced this issue Apr 27, 2023
Currently check does not look into LinkageSpecDecl
when removing redundant variable re-declarations.
This were leaving code in non-compiling state.
Fix patch fixes this and adds removal also of 'extern C'.

Fixes: llvm#42068

Reviewed By: carlosgalvezp

Differential Revision: https://reviews.llvm.org/D146904
flemairen6 pushed a commit to Xilinx/llvm-project that referenced this issue May 10, 2023
Currently check does not look into LinkageSpecDecl
when removing redundant variable re-declarations.
This were leaving code in non-compiling state.
Fix patch fixes this and adds removal also of 'extern C'.

Fixes: llvm#42068

Reviewed By: carlosgalvezp

Differential Revision: https://reviews.llvm.org/D146904
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior bugzilla Issues migrated from bugzilla clang-tidy
Projects
None yet
Development

No branches or pull requests

3 participants