[PATCH] D26423: [clang-move] Support template class.

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 9 12:03:02 PST 2016


hokein marked 3 inline comments as done.
hokein added inline comments.


================
Comment at: clang-move/ClangMove.cpp:417
+      if (const auto *FTD = CMD->getDescribedFunctionTemplate())
+        UnremovedDeclsInOldHeader.erase(FTD);
+      else
----------------
ioeric wrote:
> `erase(FTD ? FTD : CMD)`
We can't write the code like this way since the ternary operator (`condition ? E1:E2`) requires E1 and E2 has same type or they can convert to each other. In our case, the pointer types of `FTD` and `CMD` are different, and they can't convert to each other. 

We could pass the compilation by writing the code like following way, but I'd keep the current way.

```
erase(FTD ? static_cast<NamedDecl*>(FTD) : static_cast<NamedDecl*>CMD);
```  


https://reviews.llvm.org/D26423





More information about the cfe-commits mailing list