[PATCH] D117416: [clang-format] Handle C variables with name that matches c++ access specifier

psigillito via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 18 20:27:03 PST 2022

psigillito added a comment.

Ok, as I was starting to add a new language, the scope of changes just continued to grow.

If you think it is worthwhile, I think I can fix this edge case for accessSpecifiers by cleaning up my old approach and adding some tests. I dont like having to add a big set of operators to check against for handling the case where there is a typo and the colon is missing i.e.

  class foo { 
    bool jim;
    bool bob;

I think this is probably the most common error so I think we should support it.

I don't think the delete issue in https://github.com/llvm/llvm-project/issues/46915 is worth the added complexity. Without specifying the language, it is too hard to interpret the programmer's intention. For example, these are totally valid as either a delete or a function call:

  delete(foo) // foo is a pointer being deleted 
  delete(bar) // bar is a parameter to a function

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list