[cfe-commits] r94453 - /cfe/trunk/lib/CodeGen/CGDeclCXX.cpp
Fariborz Jahanian
fjahanian at apple.com
Mon Jan 25 13:40:39 PST 2010
Author: fjahanian
Date: Mon Jan 25 15:40:39 2010
New Revision: 94453
URL: http://llvm.org/viewvc/llvm-project?rev=94453&view=rev
Log:
global variable that binds reference to a non-lvalue reproted
as NYI now.
Modified:
cfe/trunk/lib/CodeGen/CGDeclCXX.cpp
Modified: cfe/trunk/lib/CodeGen/CGDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDeclCXX.cpp?rev=94453&r1=94452&r2=94453&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDeclCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDeclCXX.cpp Mon Jan 25 15:40:39 2010
@@ -80,8 +80,13 @@
EmitDeclInit(*this, D, DeclPtr);
return;
}
- RValue RV = EmitReferenceBindingToExpr(Init, T, /*IsInitializer=*/true);
- EmitStoreOfScalar(RV.getScalarVal(), DeclPtr, false, T);
+ if (Init->isLvalue(getContext()) == Expr::LV_Valid) {
+ RValue RV = EmitReferenceBindingToExpr(Init, T, /*IsInitializer=*/true);
+ EmitStoreOfScalar(RV.getScalarVal(), DeclPtr, false, T);
+ return;
+ }
+ ErrorUnsupported(Init,
+ "global variable that binds reference to a non-lvalue");
}
void
More information about the cfe-commits
mailing list