Some small fixes for fields of reference type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72636 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 4ad2bec..50fdcfd 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -231,7 +231,10 @@
   FieldDecl *FD = dyn_cast<FieldDecl>(E->getMemberDecl());
   if (!FD) // FIXME: deal with other kinds of member expressions
     return APValue();
-    
+
+  if (FD->getType()->isReferenceType())
+    return APValue();
+
   // FIXME: This is linear time.
   unsigned i = 0;
   for (RecordDecl::field_iterator Field = RD->field_begin(Info.Ctx),
@@ -1047,7 +1050,7 @@
   // Get information about the alignment.
   unsigned CharSize = Info.Ctx.Target.getCharWidth();
 
-  // FIXME: Why do we ask for the preferred alignment?
+  // __alignof is defined to return the preferred alignment.
   return Info.Ctx.getPreferredTypeAlign(T.getTypePtr()) / CharSize;
 }