Skip to content

remove cleanupAfterSimplify from the template simplifier#2998

Merged
danmar merged 1 commit into
cppcheck-opensource:mainfrom
IOBYTE:main
Dec 31, 2020
Merged

remove cleanupAfterSimplify from the template simplifier#2998
danmar merged 1 commit into
cppcheck-opensource:mainfrom
IOBYTE:main

Conversation

@IOBYTE

@IOBYTE IOBYTE commented Dec 31, 2020

Copy link
Copy Markdown
Contributor

The template simplifier works well enough now so cleanupAfterSimplify is
no longer necessary. In fact cleanupAfterSimplify was introducing a bug
which improperly simplified C++ style casts.

Bugs should be exposed and fixed properly rather than just hiding them.

The template simplifier works well enough now so cleanupAfterSimplify is
no longer necessary.  In fact cleanupAfterSimplify was introducing a bug
which improperly simplified C++ style casts.

Bugs should be exposed and fixed properly rather than just hiding them.
@danmar

danmar commented Dec 31, 2020

Copy link
Copy Markdown
Collaborator

Bugs should be exposed and fixed properly rather than just hiding them.

yes

@danmar danmar merged commit e7bdf5f into cppcheck-opensource:main Dec 31, 2020
@firewave

Copy link
Copy Markdown
Collaborator

There's an open issue about wrong simplified types in templates - see https://trac.cppcheck.net/ticket/9675. I was hoping this might have been fixed by this change but unfortunately it is not.

@IOBYTE

IOBYTE commented Dec 31, 2020

Copy link
Copy Markdown
Contributor Author

I don't see what's wrong with the output of #9675. We incorporate the template parameters into the function name to make it unique. The output won't compile but that's by design. The output looks like it's still a template function but it's not. We could have changed f<constA> to something like f_const_A to make it compile but then it's harder to see the simplification.

@firewave

Copy link
Copy Markdown
Collaborator

I would have expected the output to be void f < const A > instead ofvoid f`. Seems like it wasn't simplified.

Still the varid for t appears to be wrong.

If there's nothing wrong please add those comments to the ticket and close 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