Closed
Description
Bugzilla Link | 51544 |
Version | 12.0 |
OS | Linux |
CC | @zygoloid |
Extended Description
Hi clang-team,
I'm not sure if this is a defect or standard behaviour, but the following code compiles with gcc, but not with clang:
#include <concepts>
#ifndef MODE
#define MODE 0
#endif
struct base {
#if MODE == 0
void foo(float target){};
#elif MODE == 1
template <typename target_t>
void foo(target_t target){};
#elif MODE == 2
template <std::floating_point target_t>
void foo(target_t target){};
#endif
};
struct bar : public base {
using base::foo;
template <std::integral target_t>
void foo(target_t target){};
};
int main() {
bar f{};
f.foo(float{});
}
https://godbolt.org/z/4j5Ec688n
MODE | 0 | 1 | 2 |
---|---|---|---|
gcc | ✓ | ✓ | ✓ |
clang | ✓ | ✗ | ✗ |
msvc | ✓ | ✗ | ✗ |
I'm unsure if constructs like this are even allowed.
Thank you!
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done