The problem of cyclic dependency with inheritance
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
Research direction
Reproduce the failure by varying whether C-class.h or D-class.h is included first in a C++ translation unit, then inspect the generated class headers and the g++ error. Done means the hierarchy compiles regardless of header order, or KPHP reports a human-readable diagnostic instead of the g++ stage error.
Written by the indexing model from the issue text.
Description
Assume we have the following class hierarchy:
There is a a possible situation when such a hierarchy cannot be compiled. For example, if in any C++ Translation Unit inclusion of "С-class.h" or "D-class.h" will precede all other class headers of this hierarchy. The reason is in mechanism of header inclusion in KPHP.
A possible solution is following:
- To stop include class definition headers for properties and use only incomplete declarations.
- Include full class definitions for functions that uses such properties
Or we could just detect such situations and give human-readable error; for now it's g++ stage error:
...
error: expected class-name before ‘{’ token:
struct C$D: public C$D {
...
But, as I believe, the solution or detection would require analysis, which would take considerable time..
- Dominant language
- C++
- Stars
- 1.5k
- Forks
- 116
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 11
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from VKCOM/kphp
-
Difficulty 5/5 Over a week Newbie friendliness 10/100
-
Khan Open
Difficulty 5/5 Over a week Newbie friendliness 10/100
-
.github/CODEOWNERS Open
Difficulty 3/5 1-2 days Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 32/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·