http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56687
Bug #: 56687 Summary: [C++11] No visibility check within static_assert Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: antoine...@gmail.com template<class, class> struct same {static const bool value = false; }; template<class T> struct same<T, T> {static const bool value = true; }; template<class T> class id { typedef T type; }; static_assert( same<int, id<int>::type /* private */ >::value, "bad type"); Compile with -std=c++11 -Wall -pedantic Neither gcc nor g++ triggers an error, though id<int>::type should not be accessible (private)!