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 #11827 FP duplInheritedMember - different return type #5231

Merged
merged 5 commits into from
Jul 12, 2023

Conversation

chrchr-github
Copy link
Collaborator

No description provided.

@chrchr-github
Copy link
Collaborator Author

chrchr-github commented Jul 10, 2023

It seems that the functionConst examples "worked" only by accident.

Edit: There was an issue in CheckClass. Still not sure if we should warn for the examples from https://trac.cppcheck.net/ticket/11499
There is no guarantee that const/non-const overloads are interchangeable.
We don't warn for this equivalent code either:

struct A {
	void f() const;
};
template<class T>
struct P {
	T* get();
	const T* get() const;
};
struct S {
	P<A> p;
	void g() { p.get()->f(); }
};

@chrchr-github chrchr-github merged commit c0bd9f8 into danmar:main Jul 12, 2023
64 checks passed
@chrchr-github chrchr-github deleted the chr_Fix11827 branch July 12, 2023 13:56
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.

2 participants