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
typeMerge should take modifiers into account when searching for common base class #5450
Conversation
|
Looks good. Maybe it's also a good idea to test:
|
Good point, the case of |
Found that:
does not work, but this does:
I think I'll leave it out of the testcase, though, I'm not sure either whether or not it should be allowed. |
Rebased and updated with more tests. |
Needs the array tests too. And the test cases should all be crammed into xtest46 or one of the other existing megatests. |
@quickfur of course this:
doesnt't work! I forgot to specifying the size :D |
LGTM. |
Auto-merge toggled on |
Auto-merge toggled off |
@9rnsr This still needs the test case from the forum added (array literal type deduction) and the test should be moved out of its own file. |
@yebblies Which forum thread was that? I must have missed it. Or are you referring to the array append test case posted above? |
…n base class. Fixes issue 15638. Add test case to test suite.
Anyway, cooked up a few examples of my own. Would this do? |
I meant this thread I think this is covered now. |
Auto-merge toggled on |
typeMerge should take modifiers into account when searching for common base class
Thanks! |
Fixes issue 15638.
The problem appears to be that
typeMerge
does not copy modifiers over when searching for a common base class, so it tries to test implicit convertibility fromconst(derivedClass)
to (non-const)BaseClass
, which fails, thus it fails to find the common base class asconst(BaseClass)
.