[llvm-bugs] [Bug 45801] New: The using declaration doesn't work for parent class' constructors.
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon May 4 21:30:27 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=45801
Bug ID: 45801
Summary: The using declaration doesn't work for parent class'
constructors.
Product: clang
Version: 10.0
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++14
Assignee: unassignedclangbugs at nondot.org
Reporter: 312988336 at qq.com
CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk
The following code works in GCC 9.3 and MSVC v19.24, but fails in Clang 10.0.0
(adding the typename keyword resolves that issue, but Clang has other problems
that GCC does not).
==================
template<typename>
struct A
{
int n;
A(bool)
{}
};
template<typename>
struct B
{
struct C : A<B>
{
using Base = A<B>;
using A<B>::A; // ok
using Base::n; // ok
// error: dependent using declaration resolved to type without
'typename'
using Base::A;
};
C get() const
{
return C(true);
}
};
int main()
{
auto b = B<int>();
b.get();
}
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200505/722076e8/attachment.html>
More information about the llvm-bugs
mailing list