[PATCH] D148457: [clangd] Support macro evaluation on hover

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 29 02:04:07 PDT 2023


sammccall added a comment.

> Obviously we're expecting evaluation on such macro (which is just what the original issue addresses).

That wasn't (and isn't) obvious to me - the issue didn't mention the macro in question, i assumed it was `#define alignof(x) __alignof(x)` or similar. Looks like both forms are in use but clang provides `#define alignof __alignof` as a built-in.

A couple of ideas:

- special-case alignof
- (generalization) allow partial selection via macros that expand to a single token
- (generalization) allow partial selection as long as it's of a single node - the common ancestor is partially selected and no children are


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148457



More information about the cfe-commits mailing list