Not everything is valid (as you see in FIXME), but it should works for 99.8% cases.
I gonna fix it in next week, but I would like to land this bug fixes right now.
This is mainly fixes of the review that @sbenza gave me last time.
Differential D22208
[clang-tidy] Fixes to modernize-use-emplace Prazek on Jul 10 2016, 10:41 PM. Authored by
Details
Not everything is valid (as you see in FIXME), but it should works for 99.8% cases. I gonna fix it in next week, but I would like to land this bug fixes right now. This is mainly fixes of the review that @sbenza gave me last time.
Diff Detail Event TimelineComment Actions BTW I've made clang-extra project on phabricator as you can see. Please use it, it will be much easier to filter reviews.
Comment Actions Aaron, Alex thanks for the review. After running it on llvm I also have found the private constructor bug so I also fixed it.
Comment Actions There is one bug left: In the ClangIncludeFixer.cpp:169 there is push back that looks like this Symbols.push_back(find_all_symbols::SymbolInfo( Split.first.trim(), find_all_symbols::SymbolInfo::SymbolKind::Unknown, CommaSplits[I].trim(), 1, {}, /*NumOccurrences=*/E - I)); There is initializer list inside that should not allow this to be matched (because I check for initializer list as argument) Unfortunatelly clang AST doesn't mention any initializer list. As you can see the "{}" looks like this in AST |-MaterializeTemporaryExpr 0x7f759d803900 <col:39, col:40> 'const std::vector<Context>':'const class std::vector<struct std::pair<enum clang::find_all_symbols::SymbolInfo::ContextType, class std::basic_string<char> >, class std::allocator<struct std::pair<enum clang::find_all_symbols::SymbolInfo::ContextType, class std::basic_string<char> > > >' lvalue | | | | `-CXXBindTemporaryExpr 0x7f759d8038e0 <col:39, col:40> 'const std::vector<Context>':'const class std::vector<struct std::pair<enum clang::find_all_symbols::SymbolInfo::ContextType, class std::basic_string<char> >, class std::allocator<struct std::pair<enum clang::find_all_symbols::SymbolInfo::ContextType, class std::basic_string<char> > > >' (CXXTemporary 0x7f759d8038d8) | | | | `-CXXConstructExpr 0x7f759d8038a8 <col:39, col:40> 'const std::vector<Context>':'const class std::vector<struct std::pair<enum clang::find_all_symbols::SymbolInfo::ContextType, class std::basic_string<char> >, class std::allocator<struct std::pair<enum clang::find_all_symbols::SymbolInfo::ContextType, class std::basic_string<char> > > >' 'void (void)' | | | Good news are that this is the only 1 case from all push_backs that it found on LLVM+Clang+extra. This patch fixed the ExprWithCleanups by using ignoreImplicit, so I clang-tidy have many new push_backs. Comment Actions Ok works right now. I don't know why but I could not reproduce the error in test file, but I manged to fix it. Comment Actions LG
Comment Actions Please add revision number (this can be automated, if include differential revision URL in your commit message as described in http://llvm.org/docs/Phabricator.html#committing-a-change).
Comment Actions I normally use arc, but I was working in half from my laptop and in half from workstation, and I am not sure if arc would handle this. I added the url in the patch, but I didn't know that "Differential Revision:" is required. I will keep it in mind next time.
|
Should be Containers and Smart (capital letters).