[Bug c++/60798] New: Access checking of template alias not done at the point of use
eric.niebler at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Apr 9 19:54:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60798
Bug ID: 60798
Summary: Access checking of template alias not done at the
point of use
Product: gcc
Version: 4.8.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: eric.niebler at gmail dot com
The following compiles with clang, but not with gcc-4.8.2
////////////////////////////////////////////
template<typename Derived>
using base_t = typename Derived::base_t;
template<typename Derived>
struct base
{
private:
friend Derived;
using base_t = base;
base() {}
};
template<typename T>
struct derived : base<derived<T>>
{
using base_t<derived>::base_t;
};
int main()
{
derived<int> d;
}
/////////////////////////////////////////////
Result:
test.cpp: In substitution of ‘template<class Derived> using base_t = typename
Derived::base_t [with Derived = derived<int>]’:
test.cpp:16:26: required from ‘struct derived<int>’
test.cpp:21:16: required from here
test.cpp:9:22: error: ‘using base_t = struct base<derived<int> >’ is private
using base_t = base;
^
test.cpp:2:40: error: within this context
using base_t = typename Derived::base_t;
More information about the Gcc-bugs
mailing list