[llvm-bugs] [Bug 37600] New: error: cannot inherit constructors from const T
via llvm-bugs
llvm-bugs at lists.llvm.org
Sat May 26 07:48:38 PDT 2018
https://bugs.llvm.org/show_bug.cgi?id=37600
Bug ID: 37600
Summary: error: cannot inherit constructors from const T
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: unassignedclangbugs at nondot.org
Reporter: rustamabd at gmail.com
CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
Consider the following example:
struct A {};
using T = const A;
struct B : T {
using T::T; // error: 'const A' is not a direct base of 'B'
};
int main() {
B b;
}
The code compiles in GCC and VC14.1 but not in Clang (any version).
Obviously T must name a class for 'using T::T' to work ([class.qual]/2.2), so
according to [class.name]/5 'const' should be ignored.
In addition, the error makes no sense - how can 'const A' be a class at all?
--
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/20180526/0a131a8d/attachment.html>
More information about the llvm-bugs
mailing list