:12:15: error: static assertion failed
12 | static_assert(Concept);
| ^~~~~~~~~~~~~~~~
• constraints not satisfied
• required by the constraints of 'template concept Concept'
:1:27:
1 | template concept Concept = requires {typename T::marker;};
| ^~~~~~~
• in requirements [with T = Derived]
:1:37:
1 | template concept Concept = requires {typename T::marker;};
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
• the required type 'typename T::marker' is invalid, because
:1:56:
1 | template concept Concept = requires {typename T::marker;};
| ~~~~~~~~~^~~~~~~~~~
• error: lookup of 'marker' in 'Derived' is ambiguous
• candidates are: 'using Base2::marker = int'
:2:29:
2 | #define INJECT_MARKER using marker = int;
| ^~~~~~
• in expansion of macro 'INJECT_MARKER'
7 | INJECT_MARKER
| ^~~~~~~~~~~~~
• 'using Base1::marker = int'
:2:29:
2 | #define INJECT_MARKER using marker = int;
| ^~~~~~
• in expansion of macro 'INJECT_MARKER'
4 | INJECT_MARKER
| ^~~~~~~~~~~~~
Compiler returned: 1
There are dozens of instances of this macro in Chromium. I cannot modify the inheritance hierarchy, which may include multiple levels (we must support detecting indirect bases).
I can modify the INJECT_MARKER macro and Concept.
Help me refactor this so that the code builds with GCC.
c++gccrefactoringmultiple-inheritanceambiguous
Your Answer
lock_outline
You need to log in to submit an answer.
Privacy & Cookie Consent
We use cookies to ensure the best experience on our website. This includes analytics, personalization, and marketing purposes. Some cookies are essential for the website to function properly.
By clicking "Accept", you consent to our use of cookies. You can read more about how we use cookies and how you can change your preferences in our Privacy Policy.