http://llvm.org/bugs/show_bug.cgi?id=14316
Bug #: 14316
Summary: [patch] pretty print for anonymous structure
dereference is buggy
Product: clang
Version: 3.1
Platform: PC
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P
Component: Frontend
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
Created attachment 9524
--> http://llvm.org/bugs/attachment.cgi?id=9524
Patch for the issue
When I have an expression of the form
struct blah {
struct {
struct {
int b;
};
};
};
int foo(const struct blah *b) {
return b->b;
}
The expression 'b->b' has the following (correct) AST:
(ImplicitCastExpr 0x44bc968 'int' <LValueToRValue>
(MemberExpr 0x44bc8f0 'int' lvalue .b 0x44899b0
(MemberExpr 0x44bc8c0 'struct blah::<anonymous at blah.blk:3:9>' lvalue .
0x4489a50
(MemberExpr 0x44bc890 'struct blah::<anonymous at blah.blk:2:5>' lvalue
-> 0x44bc2f0
(ImplicitCastExpr 0x44bc878 'union blah *' <LValueToRValue>
(DeclRefExpr 0x44bc850 'union blah *' lvalue ParmVar 0x44bc440 'b'
'union blah *'))))))
Put the pretty printer badly print this as 'b.b' because all the MemberExpr
targeting anonymous types are simply ignored. The patch fix that behavior: the
arrow/dot notation is printed if the base of the expression is not anonymous.
The patch is based on the 3.1 release branch of the git mirror.
--
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