https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64335
Bug ID: 64335 Summary: decltype and access of a private member type Product: gcc Version: 5.0 Status: UNCONFIRMED Keywords: accepts-invalid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com This compiles fine: #include <chrono> class foo { std::chrono::high_resolution_clock clock;}; static_assert(!decltype(foo::clock)::is_steady, "xxx"); This doesn't: class foo { class bar {typedef int foo;}; }; int main() { decltype (foo::bar) y; } Clang rejects both.