LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 26756 - Extend readability-redundant-string-init to check for assignment of temporary strings
Summary: Extend readability-redundant-string-init to check for assignment of temporary...
Status: NEW
Alias: None
Product: clang-tools-extra
Classification: Unclassified
Component: clang-tidy (show other bugs)
Version: unspecified
Hardware: All All
: P enhancement
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-26 18:24 PST by Eugene Zelenko
Modified: 2016-03-02 17:24 PST (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Zelenko 2016-02-26 18:24:14 PST
It'll be great to extend readability-redundant-string-init to report next situations:

std::string S1 = std::string( "Value" );
std::string S2 = std::string( "" );

const char* CString;

std::string S3 = std::string( CString );

I found such example in my code base which may be not unique :-)
Comment 1 Eugene Zelenko 2016-03-02 17:24:55 PST
Check also misses empty strings in call to constructors of class members. My code base is C++03, so probably same problem will exist for C++11 member initialization.