[cfe-commits] r45078 - in /cfe/trunk: Sema/SemaExpr.cpp test/Sema/member-reference.c
Steve Naroff
snaroff at apple.com
Sun Dec 16 13:42:29 PST 2007
Author: snaroff
Date: Sun Dec 16 15:42:28 2007
New Revision: 45078
URL: http://llvm.org/viewvc/llvm-project?rev=45078&view=rev
Log:
Sema::ActOnMemberReferenceExpr() needs to perform the default conversions.
Bug and test case provided by Carl Lewis.
Added:
cfe/trunk/test/Sema/member-reference.c
Modified:
cfe/trunk/Sema/SemaExpr.cpp
Modified: cfe/trunk/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaExpr.cpp?rev=45078&r1=45077&r2=45078&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/Sema/SemaExpr.cpp Sun Dec 16 15:42:28 2007
@@ -503,6 +503,9 @@
IdentifierInfo &Member) {
Expr *BaseExpr = static_cast<Expr *>(Base);
assert(BaseExpr && "no record expression");
+
+ // Perform default conversions.
+ DefaultFunctionArrayConversion(BaseExpr);
QualType BaseType = BaseExpr->getType();
assert(!BaseType.isNull() && "no type for member expression");
Added: cfe/trunk/test/Sema/member-reference.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/member-reference.c?rev=45078&view=auto
==============================================================================
--- cfe/trunk/test/Sema/member-reference.c (added)
+++ cfe/trunk/test/Sema/member-reference.c Sun Dec 16 15:42:28 2007
@@ -0,0 +1,9 @@
+// RUN: clang %s -verify -fsyntax-only
+
+struct simple { int i; };
+
+void f(void) {
+ struct simple s[1];
+ s->i = 1;
+}
+
More information about the cfe-commits
mailing list