[PATCH] D58111: [Sema] Fix a crash in access checking for deduction guides

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 12 02:58:21 PST 2019


sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:3178
       auto *TD = DG->getDeducedTemplate();
-      if (AS != TD->getAccess()) {
+      bool InSameScope = TD->getDeclContext()->getRedeclContext()->Equals(
+          DG->getDeclContext()->getRedeclContext());
----------------
this isn't quite trivial, you might want to short circuit with &&, checking AS != TD->getAccess() first?
I don't think readability is too bad if you keep the existing comment.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58111/new/

https://reviews.llvm.org/D58111





More information about the cfe-commits mailing list