[PATCH] D38618: Do not add a colon chunk to the code completion of class inheritance access modifiers

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 23 14:08:13 PDT 2017


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

Overall LGTM, just a couple of comments:



================
Comment at: include/clang/Sema/Scope.h:131
+
+    /// We are between inheritance colon and the real class/struct definition scope
+    ClassInheritanceScope = 0x800000,
----------------
Nit: Add '.' to the end of the comment + clang-format.


================
Comment at: lib/Parse/ParseDeclCXX.cpp:3198
   if (Tok.is(tok::colon)) {
+    ParseScope InheritanceScope(this, Scope::ClassScope | Scope::DeclScope |
+                                          Scope::ClassInheritanceScope);
----------------
Might be better to use `getCurScope()->getFlags() | Scope::ClassInheritanceScope` to avoid dealing with any future scoping rule changes if such changes will occur.


================
Comment at: lib/Sema/SemaCodeComplete.cpp:1661
 
+        bool IsNotInheritanceScope = !(S->getFlags() & Scope::ClassInheritanceScope);
         // public:
----------------
80 columns violation, please clang-format


https://reviews.llvm.org/D38618





More information about the cfe-commits mailing list