llvm / llvm/llvm-project

Clang gets confused when parsing dependent types in construct calls

Open
#221,874 4 comments 0 reactions 3 assignees Claimed by @shafik View on GitHub
clang:frontend rejects-valid
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

I was trying to work out what the core issue behind #221209 was, and while traipsing through the code around dependent member lookup and after some debugger driven futzing I give you: bizarre responses to valid code, but only in constructor arguments, because of course.

```cpp
template struct A { };

template<> struct A { struct B { static int *c; }; };
struct S { S(int); };
template void f() { S(*A::B::c); }
void g() { f(); }
// did you mean A

template struct B { };
template<> struct B { static int *c; };
template void h() { S(*B::c); }
// c is redeclared???
void i() { h(); }
```

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.