Fix compilation errors when building inside Chromium
authorCorentin Wallez <corentin@wallez.net>
Tue, 4 Oct 2016 21:47:19 +0000 (17:47 -0400)
committerCorentin Wallez <corentin@wallez.net>
Tue, 4 Oct 2016 21:47:19 +0000 (17:47 -0400)
Example of an error:
    spirv-tools/source/validate_cfg.cpp:516:45: error: chosen constructor is
    explicit in copy-initialization:
      _.current_function().RegisterBlockEnd({}, opcode);

source/val/BasicBlock.h
source/val/Construct.h
source/validate_cfg.cpp

index d44b76f..29d730c 100644 (file)
@@ -108,7 +108,7 @@ class BasicBlock {
   void RegisterBranchInstruction(SpvOp branch_instruction);
 
   /// Adds @p next BasicBlocks as successors of this BasicBlock
-  void RegisterSuccessors(const std::vector<BasicBlock*>& next = {});
+  void RegisterSuccessors(const std::vector<BasicBlock*>& next = std::vector<BasicBlock*>());
 
   /// Returns true if the id of the BasicBlock matches
   bool operator==(const BasicBlock& other) const { return other.id_ == id_; }
index 06a0c0d..09cf9df 100644 (file)
@@ -46,7 +46,7 @@ class Construct {
  public:
   Construct(ConstructType type, BasicBlock* dominator,
             BasicBlock* exit = nullptr,
-            std::vector<Construct*> constructs = {});
+            std::vector<Construct*> constructs = std::vector<Construct*>());
 
   /// Returns the type of the construct
   ConstructType type() const;
index ac81f75..7843697 100644 (file)
@@ -513,7 +513,7 @@ spv_result_t CfgPass(ValidationState_t& _,
     case SpvOpReturn:
     case SpvOpReturnValue:
     case SpvOpUnreachable:
-      _.current_function().RegisterBlockEnd({}, opcode);
+      _.current_function().RegisterBlockEnd(vector<uint32_t>(), opcode);
       break;
     default:
       break;