template<class T, class S = Foo> class Class; class Foo {}; template<class T, class S> class Class { }; C:\src\chrome\src>cl test.cc /c Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. test.cc C:\src\chrome\src>..\..\llvm-build\bin\Release\clang.exe -c test.cc test.cc:1:29: error: unknown type name 'Foo' template<class T, class S = Foo> ^ 1 error generated. This is required to parse atlwin.h
cl also accepts: template<class T, class S = Foo> class Class; template<class T, class S> class Class { }; class Foo {}; void f() { Class<int> c; } It doesn't accept: template<class T, class S = Foo> class Class; template<class T, class S> class Class { }; void f() { Class<int> c; } class Foo {};
*** Bug 16180 has been marked as a duplicate of this bug. ***
This was fixed in r210382, we accept with a warning: $ clang -c t.cpp t.cpp:1:29: warning: using the undeclared type 'Foo' as a default template argument is a Microsoft extension [-Wmicrosoft] template<class T, class S = Foo> ^ 1 warning generated.