Browse Source

[spirv] Fix Linux/macOS build. (#1735)

Fixed ternary op ambiguity.
Ehsan 6 years ago
parent
commit
c12f1ae8f2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      tools/clang/lib/SPIRV/SPIRVEmitter.cpp

+ 1 - 1
tools/clang/lib/SPIRV/SPIRVEmitter.cpp

@@ -4712,7 +4712,7 @@ SpirvEvalInfo SPIRVEmitter::doUnaryOperator(const UnaryOperator *expr) {
 
     const spv::Op spvOp = translateOp(isInc ? BO_Add : BO_Sub, subType);
     const uint32_t originValue =
-        subValue.isRValue() ? subValue
+        subValue.isRValue() ? uint32_t(subValue)
                             : theBuilder.createLoad(subTypeId, subValue);
     const uint32_t one = hlsl::IsHLSLMatType(subType)
                              ? getMatElemValueOne(subType)