diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp index a95353fd2943c..f6e0b54a81e36 100644 --- a/clang/lib/AST/ByteCode/Compiler.cpp +++ b/clang/lib/AST/ByteCode/Compiler.cpp @@ -5911,6 +5911,9 @@ bool Compiler::VisitVectorUnaryOperator(const UnaryOperator *E) { return this->discard(SubExpr); auto UnaryOp = E->getOpcode(); + if (UnaryOp == UO_Extension) + return this->delegate(SubExpr); + if (UnaryOp != UO_Plus && UnaryOp != UO_Minus && UnaryOp != UO_LNot && UnaryOp != UO_Not && UnaryOp != UO_AddrOf) return this->emitInvalid(E); diff --git a/clang/test/AST/ByteCode/vectors.cpp b/clang/test/AST/ByteCode/vectors.cpp index 08e2ca2adbf5c..a04b678a623a1 100644 --- a/clang/test/AST/ByteCode/vectors.cpp +++ b/clang/test/AST/ByteCode/vectors.cpp @@ -37,6 +37,7 @@ static_assert(arr4[1][0] == 0, ""); static_assert(arr4[1][0] == 0, ""); static_assert(arr4[1][0] == 0, ""); +constexpr VI4 B = __extension__(A); /// From constant-expression-cxx11.cpp namespace Vector {