llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.05k stars 11.08k forks source link

Constructor inheritance with parent class alias fails for nested templates #22616

Open llvmbot opened 9 years ago

llvmbot commented 9 years ago
Bugzilla Link 22242
Version 3.5
OS Linux
Reporter LLVM Bugzilla Contributor
CC @yaoxinliu,@DougGregor,@JaschaWetzel,@jbreitbart

Extended Description

Compiling the following code with clang++ -c test.cpp -std=c++11 fails with the missleading error message

test.cpp:14:14: error: dependent using declaration resolved to type without 'typename' using Base::B;

template class A {};

template class B { public: B(){}; };

template class C : public B<A> { public: using Base = B<A>; using Base::B; // <-- Error here };

static const C c{};

When writing one of the following, equivalent statements instead of "using Base::B" the code compiles:

using Base::Base using B<A>::Base

The error does also not occur if A is not a templated class. The code compiles fine with gcc 4.9. I've posted a question at stackoverflow regarding this problem at http://stackoverflow.com/q/27954940/2188211

ec04fc15-fa35-46f2-80e1-5d271f2ef708 commented 2 years ago

mentioned in issue llvm/llvm-bugzilla-archive#45801

ec04fc15-fa35-46f2-80e1-5d271f2ef708 commented 2 years ago

mentioned in issue llvm/llvm-bugzilla-archive#23107

ec04fc15-fa35-46f2-80e1-5d271f2ef708 commented 4 years ago

Bug llvm/llvm-bugzilla-archive#45801 has been marked as a duplicate of this bug.

ec04fc15-fa35-46f2-80e1-5d271f2ef708 commented 9 years ago

Bug llvm/llvm-bugzilla-archive#23107 has been marked as a duplicate of this bug.

ec04fc15-fa35-46f2-80e1-5d271f2ef708 commented 9 years ago

Bug llvm/llvm-project#22281 has been marked as a duplicate of this bug.