0
#include<string>

enum Math { ONE };
template<Math math, class C, typename T = std::string, typename... Args>
void foo (T t = {}, Args&& ...) {}

class A {};
int main ()
{
  foo<ONE, A>(); // OK
  foo<ONE, A>(""); // OK
  foo<ONE, A>("", 0);  // error: missing default argument on parameter pack
}

Already referred below post & upgraded the compiler but still above code doesn't compile in clang-10,11 in Ubuntu & Mac.
Why clang missing default argument on parameter pack error?

Is it still a bug?

iammilind
  • 68,093
  • 33
  • 169
  • 336
  • 3
    Seems to work fine since Clang-11: https://godbolt.org/z/cxea8jhfx (Note that Apple Clang uses different version numbering than upstream.) – user17732522 Feb 07 '22 at 06:22
  • 1
    @user17732522, the Clang in Mac is upgraded via XCode way as mentioned in the old linked post. It shows the version as 11 and in Ubuntu, the version is 10. However as per the linked post the error was supposed to be fixed around Oct, 20 itself. In the godbolt link, as we can see that the version 10 still gives an error. How to verify the correct version of the Mac Clang? – iammilind Feb 07 '22 at 06:35
  • 1
    The error for version 10 is expected, since the fix is only included in the 11 release. To check the Clang version on Mac, look at the table [here](https://en.wikipedia.org/wiki/Xcode#Xcode_7.0_-_10.x_(since_Free_On-Device_Development)_2) to map your Xcode version. The version we are talking about and that is used on godbolt is labeled "LLVM" in the table. In other words, you need Xcode 12.5 or later. – user17732522 Feb 07 '22 at 06:42
  • I have both clang++-10 and clang++-11 installed in Ubuntu and they act just as I wrote in the answer you linked to. It fails with clang++-10 but complies fine with clang++-11. – Ted Lyngmo Feb 07 '22 at 09:56

0 Answers0