Parameter of sizeof is always highlighted as a type #12

Closed
opened 2026-01-03 19:38:32 +01:00 by shitpoet · 1 comment
shitpoet commented 2026-01-03 19:38:32 +01:00 (Migrated from github.com)

Screenshot:

Code:

int main() {
    int variableNameNotATypeName;
    return sizeof(variableNameNotATypeName);  
    //                        ^^^^^ highlighted as a type, although it is a variable
}
Screenshot: <img src='https://sshots.shitpoet.cc/2026-01-03--223511--202724411.png'> Code: ```cpp int main() { int variableNameNotATypeName; return sizeof(variableNameNotATypeName); // ^^^^^ highlighted as a type, although it is a variable } ```
marijnh commented 2026-01-03 21:08:11 +01:00 (Migrated from github.com)

The parser does not keep a symbol table. As such, it won't be able to distinguish between types and variables in places where either can occur.

The parser does not keep a symbol table. As such, it won't be able to distinguish between types and variables in places where either can occur.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lezer/cpp#12
No description provided.