aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r--lib/CodeGen/CGDecl.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index 9de722e19d..e0ceaf6a2a 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/lib/CodeGen/CGDecl.cpp
@@ -126,6 +126,11 @@ void CodeGenFunction::EmitStaticBlockVarDecl(const VarDecl &D) {
if (D.getType()->isVariablyModifiedType())
EmitVLASize(D.getType());
+ if (D.getType()->isReferenceType()) {
+ CGM.ErrorUnsupported(&D, "static declaration with reference type");
+ return;
+ }
+
if (D.getInit()) {
llvm::Constant *Init = CGM.EmitConstantExpr(D.getInit(), D.getType(), this);
@@ -324,6 +329,11 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) {
DI->EmitDeclareOfAutoVariable(&D, DeclPtr, Builder);
}
+ if (D.getType()->isReferenceType()) {
+ CGM.ErrorUnsupported(&D, "declaration with reference type");
+ return;
+ }
+
// If this local has an initializer, emit it now.
if (const Expr *Init = D.getInit()) {
llvm::Value *Loc = DeclPtr;