[PATCH] D30248: [libclang] Fix crash in member access code completion with implicit base

Benjamin Kramer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 27 01:35:09 PDT 2017


bkramer accepted this revision.
bkramer added a comment.
This revision is now accepted and ready to land.

Let's fix those crashes one at a time. This patch looks good, only minor comments below.



================
Comment at: lib/Sema/SemaOverload.cpp:6311
+      if (isa<CXXMethodDecl>(FD) && !cast<CXXMethodDecl>(FD)->isStatic()) {
+        QualType ObjectType;
+        Expr::Classification ObjectClassification;
----------------
This could use a comment explaining that this can happen if there's an error in the code, e.g. in code completion context.


================
Comment at: lib/Sema/SemaOverload.cpp:6329
+          !cast<CXXMethodDecl>(FunTmpl->getTemplatedDecl())->isStatic()) {
+        QualType ObjectType;
+        Expr::Classification ObjectClassification;
----------------
Same here.


https://reviews.llvm.org/D30248





More information about the cfe-commits mailing list