http://llvm.org/bugs/show_bug.cgi?id=21350
Bug ID: 21350
Summary: sizeof on member of a nested class does not compile
with error invalid use of non-static data member
Product: clang
Version: 3.4
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
In c++98 sizeof on a non-static struct member was not legal without an
instance. c++11 allow it.
It's working fine with struct but not with nested struct.
Here an example to trigger the problem:
#include <iostream>
struct Foo
{
int m_member;
struct Nested
{
int m_nestedMember;
};
Foo()
{
std::cout << sizeof(Foo::m_member); // Ok
std::cout << sizeof(Nested::m_nestedMember); // Bug in clang in c++11
mode: error: invalid use of non-static data member 'm_nestedMember'
}
};
int main()
{
Foo foo;
return 0;
}
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs