зеркало из https://github.com/microsoft/clang-1.git
Fix a problem related to rewrite of anonymous unions.
(fixes radar 6948022) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93186 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
c027e54d66
Коммит
97fd83a8d8
|
@ -739,9 +739,10 @@ void StmtPrinter::VisitCallExpr(CallExpr *Call) {
|
||||||
void StmtPrinter::VisitMemberExpr(MemberExpr *Node) {
|
void StmtPrinter::VisitMemberExpr(MemberExpr *Node) {
|
||||||
// FIXME: Suppress printing implicit bases (like "this")
|
// FIXME: Suppress printing implicit bases (like "this")
|
||||||
PrintExpr(Node->getBase());
|
PrintExpr(Node->getBase());
|
||||||
|
if (FieldDecl *FD = dyn_cast<FieldDecl>(Node->getMemberDecl()))
|
||||||
|
if (FD->isAnonymousStructOrUnion())
|
||||||
|
return;
|
||||||
OS << (Node->isArrow() ? "->" : ".");
|
OS << (Node->isArrow() ? "->" : ".");
|
||||||
// FIXME: Suppress printing references to unnamed objects
|
|
||||||
// representing anonymous unions/structs
|
|
||||||
if (NestedNameSpecifier *Qualifier = Node->getQualifier())
|
if (NestedNameSpecifier *Qualifier = Node->getQualifier())
|
||||||
Qualifier->print(OS, Policy);
|
Qualifier->print(OS, Policy);
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
// RUN: %clang_cc1 -rewrite-objc -o - %s
|
||||||
|
// rdar://6948022
|
||||||
|
|
||||||
|
typedef unsigned int uint32_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
union {
|
||||||
|
uint32_t daysOfWeek;
|
||||||
|
uint32_t dayOfMonth;
|
||||||
|
};
|
||||||
|
uint32_t nthOccurrence;
|
||||||
|
} OSPatternSpecificData;
|
||||||
|
|
||||||
|
@interface NSNumber
|
||||||
|
+ (NSNumber *)numberWithLong:(long)value;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface OSRecurrence {
|
||||||
|
OSPatternSpecificData _pts;
|
||||||
|
}
|
||||||
|
- (void)_setTypeSpecificInfoOnRecord;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation OSRecurrence
|
||||||
|
- (void)_setTypeSpecificInfoOnRecord
|
||||||
|
{
|
||||||
|
[NSNumber numberWithLong:(_pts.dayOfMonth >= 31 ? -1 : _pts.dayOfMonth)];
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
Загрузка…
Ссылка в новой задаче