http://llvm.org/bugs/show_bug.cgi?id=11036
Summary: Problem with sizeof accessing a class member inside a
struct
Product: clang
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: Frontend
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
With the following code:
class C {
int i;
void f (void) {
typedef int a[sizeof (i)];
typedef struct {
int a[sizeof (i)];
} s;
}
};
I get the following error from clang:
a.cc:7:18: error: invalid use of nonstatic data member 'i'
int a[sizeof (i)];
^
1 error generated.
Ie. clang doesn't like sizeof(i) in a struct, but it's ok in a non-struct.
Looks like a bug to me.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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