New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(cpp) decltype(auto) preceded by specifiers #1222
Comments
Is this still an issue? Wouldn't it also be resolved by simply excluding keywords from IDENT_RE so that a keyword would never count as the name of a function? I assume there is no way to name a function a reserved keyword, correct? |
This is worth thought because the parser by default doesn't look for keywords first, it looks for "language constructs" (other parser rules) and then in-between those it will highlight any keywords. So the problem here is we first find what looks like a function and then we highlight it... so we're looking for a title at that point, not a keyword. I wonder if this could be fixed with negative look-ahead, which is what I was hinting at. I presume we "like" the ability to highlight function titles and that losing that would be a pretty big loss. Can you provide a little more context regarding what |
We're never going to be able to handle all edge cases involving pre-processor directives - since we don't have access to the actual source - only the raw source. |
@Arcoth Default arguments exist in C++, so couldn't one use ternary when defining a default argument? So wouldn't |
@Arcoth Does that look right to you? |
- enh(cpp) Properly detect decltype(auto) - enh(cpp) recognize primitive types (`int8_t`, etc.) as function types - enh(cpp) Detect namespaced function types (`A::typeName func(...)`) - enh(cpp) Detect namespaced functions also (`A::functionName`) - enh(cpp) template type in function declaration (`vector<int> func(...)`) Closes #1730. Closes #1222. Closes #1502.
If
constexpr decltype(auto)
occurs in C++(14) code,decltype
is not highlighted correctly, presumably since this looks like a function declaration withdecltype
being the name. This will also occur with other specifiers, e.g.friend
,typedef
,inline
etc.In fact, this can occur with keywords other than
decltype
. See e.g.I'd suggest dropping that heuristic entirely.
The text was updated successfully, but these errors were encountered: