[cfe-commits] r138639 - /cfe/trunk/lib/CodeGen/CGCall.cpp

John McCall rjmccall at apple.com
Fri Aug 26 11:42:59 PDT 2011


Author: rjmccall
Date: Fri Aug 26 13:42:59 2011
New Revision: 138639

URL: http://llvm.org/viewvc/llvm-project?rev=138639&view=rev
Log:
Assert that a call argument is a gl-value iff the parameter is a reference type.


Modified:
    cfe/trunk/lib/CodeGen/CGCall.cpp

Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=138639&r1=138638&r2=138639&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Fri Aug 26 13:42:59 2011
@@ -1431,6 +1431,9 @@
     return emitWritebackArg(*this, args, CRE);
   }
 
+  assert(type->isReferenceType() == E->isGLValue() &&
+         "reference binding to unmaterialized r-value!");
+
   if (type->isReferenceType())
     return args.add(EmitReferenceBindingToExpr(E, /*InitializedDecl=*/0),
                     type);





More information about the cfe-commits mailing list