You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The readability-redundant-string-init check tells me that the string 'a' has redundant string initialization. However, if I remove this, the code no longer compiles in the large picture, as I have callers of fn() without this string argument.
I've currently changed my code to: void fn(std::string a = std::string{});
This is most likely the better way of writing this code, however I still need to initialize a, hence the init is not redundant.
Note: clang-tidy has been build with rev264514.
PS: I've also noticed that this checker doesn't cover the init-list of a constructor, don't know if that is already worth logging a bug for.
The text was updated successfully, but these errors were encountered:
Extended Description
#include
void fn(std::string a = "");
The readability-redundant-string-init check tells me that the string 'a' has redundant string initialization. However, if I remove this, the code no longer compiles in the large picture, as I have callers of fn() without this string argument.
I've currently changed my code to: void fn(std::string a = std::string{});
This is most likely the better way of writing this code, however I still need to initialize a, hence the init is not redundant.
Note: clang-tidy has been build with rev264514.
PS: I've also noticed that this checker doesn't cover the init-list of a constructor, don't know if that is already worth logging a bug for.
The text was updated successfully, but these errors were encountered: