Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Member type hides template parameter of member template #37950

Open Quuxplusone opened 6 years ago

Quuxplusone commented 6 years ago
Bugzilla Link PR38977
Status NEW
Importance P normal
Reported by Ole Kniemeyer (o_kniemeyer@maxon.de)
Reported on 2018-09-17 08:15:44 -0700
Last modified on 2018-09-17 10:49:13 -0700
Version trunk
Hardware Macintosh MacOS X
CC llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
The following code

struct S
{
    template <int P> class N;
    using P = int;
};

template <int P> class S::N
{
    static const int C = P;
};

results in

error: unexpected type name 'P': expected expression
    static const int C = P;
                         ^
So Clang resolves P to the member type S::P, but it should resolve to the
template parameter of S::N.
Quuxplusone commented 6 years ago

Confirmed, see http://eel.is/c++draft/temp.local#7 for the relevant rule.