hokein added inline comments.

================
Comment at: clang/lib/Parse/ParseDeclCXX.cpp:1012
+    // token doesn't have it.
+    DS.setTypeofParensRange(SourceRange(SourceLocation(), EndLoc));
     ConsumeAnnotationToken();
----------------
This is unfortunate for a common case `decltype(expression) a;`, the 
`ParseDecltypeSpecifier` is called twice to parse the decltype specifier: 

- first time, we parse the raw decltype token, and we annotate that (the `DS` 
was created locally, and then was thrown away)
- second time, we parsed the annotated decltype, and set another `DS`, at this 
point, we lost the LParen information :(

One way to fix that is to add a new field `SourceLocation` in `Token` class 
(there is 4-bytes padding size left, so it won't increase its size), but I'm a 
little worried, it seems like an overkill to just fix this issue. 




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116793

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to