[PATCH] D18293: [clang-tidy] Fix redundant-string-init check with msvc 14 headers.

Etienne Bergeron via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 18 22:03:31 PDT 2016


etienneb created this revision.
etienneb added a reviewer: alexfh.
etienneb added a subscriber: cfe-commits.

The string constructors are not defined using optional parameters and are not recognized by the redundant-string-init checker.

The following patch fixes the redundant-string-init checker for the Visual Studio 14 headers file.
The matcher now accept both variant (with 1 and 2 parameters).

Also added new unittests.

Similar issue than: [[ http://reviews.llvm.org/D18285 | review ]]

In the xstring.h header, the constructors are defined this way:
```
basic_string(const _Myt& _Right) [...]
basic_string(const _Myt& _Right, const _Alloc& _Al) [...]
```

http://reviews.llvm.org/D18293

Files:
  RedundantStringInitCheck.cpp
  readability-redundant-string-init-msvc.cpp
  readability-redundant-string-init.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18293.51104.patch
Type: text/x-patch
Size: 7016 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160319/aa648b74/attachment.bin>


More information about the cfe-commits mailing list