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-tidy breaks source code when fixing namespace comments #23504

Closed
rnburn mannequin opened this issue Apr 6, 2015 · 2 comments
Closed

clang-tidy breaks source code when fixing namespace comments #23504

rnburn mannequin opened this issue Apr 6, 2015 · 2 comments
Labels
bugzilla Issues migrated from bugzilla clang-tidy

Comments

@rnburn
Copy link
Mannequin

rnburn mannequin commented Apr 6, 2015

Bugzilla Link 23130
Resolution FIXED
Resolved on Apr 08, 2015 07:55
Version unspecified
OS All
Attachments patch
CC @rnburn

Extended Description

I built with a recent version of the clang-tidy

rnburn@localhost ~/bugs/ns-clang-tidy $ clang-tidy --version
LLVM (http://llvm.org/):
LLVM version 3.7.0svn
Optimized build.
Built Mar 30 2015 (04:29:52).
Default target: x86_64-unknown-linux-gnu
Host CPU: core-avx2

If I set up this file


//test.cpp
namespace a { namespace b {

void f() {
}

}}


Then run

clang-tidy -fix test.cpp -checks='*' -- -x c++ -std=c++1y -stdlib=libc++

It generates this file


//test.cpp -fixed
namespace a { namespace b {

void f() {
}

} // namespace b
// namespace a


Note that it left out one of the closing braces for the namespace and breaks the source code.

@llvmbot
Copy link
Collaborator

llvmbot commented Apr 8, 2015

Thanks for the report and the proposed fix! I'll add a test and submit a fix shortly.

@llvmbot
Copy link
Collaborator

llvmbot commented Apr 8, 2015

Fixed in r234403.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
This issue was closed.
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-tidy
Projects
None yet
Development

No branches or pull requests

1 participant