https://llvm.org/bugs/show_bug.cgi?id=26893
Bug ID: 26893 Summary: sizeof non-static member of struct nested within class template (-std=c++11) Product: clang Version: 3.6 Hardware: PC OS: Windows NT Status: NEW Severity: normal Priority: P Component: C++11 Assignee: unassignedclangb...@nondot.org Reporter: bobmore...@gmail.com CC: dgre...@apple.com, llvm-bugs@lists.llvm.org Classification: Unclassified In clang/llvm 3.6.2, the following code results in a compilation error when compiling with std=c++11: template <typename T=void> class bar { public: struct foo { int array[10]; }; int baz() { return sizeof(foo::array); } }; int main(void) { bar<> b; return b.baz(); } The same code compiles cleanly if I make bar a simple class and not a template. Stack overflow user ecatmur also posted a reduced example: template<class T> struct M { int f() { return sizeof(T::x); } }; struct S { int x; }; int main() { return M<S>{}.f(); } -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs