Skip to content
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

Fix syntaxError with using namespace ::std (f'up to #8454) #6100

Merged
merged 1 commit into from
Mar 10, 2024

Conversation

chrchr-github
Copy link
Collaborator

Why do %type% and %name% match keywords?

@firewave
Copy link
Collaborator

firewave commented Mar 8, 2024

Why do %type% and %name% match keywords?

Because we might have a bug. I vaguely remember something similar (I might be mistaken though). Maybe add some additional unit tests for that.

There's also https://trac.cppcheck.net/ticket/11169 which could be addressed along the way. Looking at the ticket it seems to explain the issue you are seeing...

@chrchr-github
Copy link
Collaborator Author

I bet we also have code that relies on the current behavior...

@firewave
Copy link
Collaborator

firewave commented Mar 8, 2024

I bet we also have code that relies on the current behavior...

For sure. Just makes things more interesting. The fun never ends...

But just having TODO testcases would be a start.

@chrchr-github
Copy link
Collaborator Author

Just changing %type% alone causes massive test failures all over the place.
The comments from Token::Match() are also hilarious:

     * - "%name%" any token which is a name, variable or type e.g. "hello" or "int"
     * - "%type%" Anything that can be a variable type, e.g. "int", but not "delete".

@firewave
Copy link
Collaborator

firewave commented Mar 8, 2024

TGIF

Copy link
Owner

@danmar danmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@danmar
Copy link
Owner

danmar commented Mar 10, 2024

Why do %type% and %name% match keywords?

this is old decisions I don't even remember exactly. but in my head %name% is broad and I think it makes sense it matches keywords.

if we can make %type% more intuitive that is good.. I would not be strongly against that in theory. but well in practice I guess it breaks tons of code so let's be careful.

@chrchr-github chrchr-github merged commit f9f3fe0 into danmar:main Mar 10, 2024
64 checks passed
@chrchr-github chrchr-github deleted the chr_usingstd branch March 10, 2024 21:12
@firewave
Copy link
Collaborator

if we can make %type% more intuitive that is good.. I would not be strongly against that in theory. but well in practice I guess it breaks tons of code so let's be careful.

We could introduce some debug or internal checks to try to get a hold on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants