Support checking and codegen of constant vector globals
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46343 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/Expr.cpp b/AST/Expr.cpp
index 8aa5eed..becce2a 100644
--- a/AST/Expr.cpp
+++ b/AST/Expr.cpp
@@ -487,7 +487,8 @@
case CompoundLiteralExprClass:
if (Loc) *Loc = getLocStart();
// Allow "(int []){2,4}", since the array will be converted to a pointer.
- return TR->isArrayType();
+ // Allow "(vector type){2,4}" since the elements are all constant.
+ return TR->isArrayType() || TR->isVectorType();
case UnaryOperatorClass: {
const UnaryOperator *Exp = cast<UnaryOperator>(this);