mgehre added inline comments.
================
Comment at: clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp:80
@@ +79,3 @@
+ std::string CastText = ("dynamic_cast<" + DestTypeString + ">").str();
+ if (!isa<ParenExpr>(SubExpr)) {
+ CastText.push_back('(');
----------------
aaron.ballman wrote:
> Why do we need this check? Perhaps we want to use IgnoreParenImpCasts()
> instead?
If the cast looks like
```
Derived* D = (Derived*)B;
```
we need to add parenthesis around B to turn it into
```
Derived* D = dynamic_cast<Derived*>(B);
```
If instead we already had
```
Derived* D = (Derived*)(B);
```
adding the parenthesis can be skipped.
http://reviews.llvm.org/D14096
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits