a.sidorin added inline comments.

================
Comment at: lib/AST/ASTImporter.cpp:6207
+    TypeSourceInfo *TSI = Importer.Import(E->getTypeOperandSourceInfo());
+    if (!TSI && E->getTypeOperandSourceInfo())
+      return nullptr;
----------------
As I see from usage of `getTypeOperandSourceInfo()`, it cannot return nullptr. 
`getExprOperand()` is used unchecked sometimes too, but not everywhere.


================
Comment at: unittests/AST/ASTImporterTest.cpp:653
+             Lang_CXX, "", Lang_CXX, Verifier,
+             functionDecl(hasDescendant(cxxTypeidExpr())));
+}
----------------
This will find only the first `typeid()`. How about something like this:
```
void declToImport() {"
             "  int x;"
             " auto a = typeid(int), b = typeid(x);"
             "}",
             Lang_CXX, "", Lang_CXX, Verifier,
             functionDecl(has(varDecl(hasName("a"), 
hasInitializer(cxxTypeidExpr())),
                                      has(varDecl(hasName("b"), 
hasInitializer(cxxTypeidExpr())));
```
?


https://reviews.llvm.org/D42335



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to