aboutsummaryrefslogtreecommitdiff
path: root/CodeGen/CGExprScalar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CodeGen/CGExprScalar.cpp')
-rw-r--r--CodeGen/CGExprScalar.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/CodeGen/CGExprScalar.cpp b/CodeGen/CGExprScalar.cpp
index 8ec1a83318..652729ac27 100644
--- a/CodeGen/CGExprScalar.cpp
+++ b/CodeGen/CGExprScalar.cpp
@@ -130,7 +130,11 @@ public:
unsigned NumInitElements = E->getNumInits();
const llvm::VectorType *VType =
- cast<llvm::VectorType>(ConvertType(E->getType()));
+ dyn_cast<llvm::VectorType>(ConvertType(E->getType()));
+
+ // We have a scalar in braces. Just use the first element.
+ if (!VType)
+ return Visit(E->getInit(0));
unsigned NumVectorElements = VType->getNumElements();
const llvm::Type *ElementType = VType->getElementType();