llvm / llvm/llvm-project

Clang accepts invalid program involving multiple inherited type members

Open
#174,089 3 comments 0 reactions 0 assignees View on GitHub
clang:frontend cwg-issue diverges-from:gcc
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

The following invalid program is accepted by clang but rejected by gcc and others. [Demo](https://godbolt.org/z/qsco3fq5c)
```
template concept Concept = requires {typename T::marker;};
#define INJECT_MARKER using marker = int;
struct Base1{
INJECT_MARKER
};
struct Base2{
INJECT_MARKER
};

struct Derived: Base1, Base2{};

static_assert(Concept);
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.