Skip to content

[concepts] Clang ignores using-declaration of template member of base class #50886

Closed
@marehr

Description

@marehr
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

bugzillaIssues migrated from bugzillac++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"conceptsC++20 concepts

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions