Clang doesn't allow variadic arguments after default parameter, gcc does

Viewed 35

I have this declaration:

    template<class... Types>
    static void DispatchCompute(
        EffectFramework& frame_work,
        const std::string& shader_path,
        const std::vector<GpuDataBufferInfo<VulkanImage*>>& textures,
        const std::vector<GpuDataBufferInfo<VulkanBuffer>>& buffers,
        const Eigen::Vector3i& work_groups = {1, 0, 0},
        const Types&... args);

And lower down I have the definition. Gcc compiles this code just fine, but clang errors with:

error: missing default argument on parameter 'args' const Types&... args)

As far as I know the above is perfectly valid C++, you can add a variadic list after a default argument. I am not sure how to circumvent the error.

0 Answers
Related