4 ms·
Clang does figure it out. Note that clang has a branch, not a loop. It jumps to returning 0, else it continues to do the same thing gcc does. I'd say it figured
by celrod 3y ago
Clang does figure it out. Note that clang has a branch, not a loop. It jumps to returning 0, else it continues to do the same thing gcc does.
I'd say it figured it out, even if the code isn't as pretty.
I tried using `final` to get them to figure out the inheritance case, but devirtualization didn't work when inlining a method defined on a base class.
https://godbolt.org/z/h4GEYnzMo https://godbolt.org/z/h4GEYnzMo
- nemetroid 3y agoYou're right, I should have read the Clang output more closely. The part about final inheritance makes sense, too, because otherwise a subclass could override the behaviour and count_concept() would have to support that.