[PATCH] D86719: [SyntaxTree][NFC] Refactor function templates into functions taking base class

Eduardo Caldas via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 28 02:29:30 PDT 2020


eduucaldas added inline comments.


================
Comment at: clang/lib/Tooling/Syntax/BuildTree.cpp:225-226
+///     `int *a = nullptr` -> range of `= nullptr`.
+///     `int a{}` -> range of `{}`.
+///     `int a()` -> range of `()`.
+static SourceRange getInitializerRange(Decl *D) {
----------------
I followed the grammar to get these and also added tests for them.


================
Comment at: clang/lib/Tooling/Syntax/BuildTree.cpp:245
+///     `int S::f(){}` -> range of `S::f()`.
+/// FIXME: \p Name must be a source range, e.g. for `operator+`.
 static SourceRange getDeclaratorRange(const SourceManager &SM, TypeLoc T,
----------------
There was no problem with the declarator of `operator+` should I remove this?
Also I really tried to break it ^^.

I think though perhaps this is going to bite us in an obscure way, so I would just remove the `e.g. ...`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86719



More information about the cfe-commits mailing list