You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
https://timsong-cpp.github.io/cppwp/std11/temp.deduct.call#4 says that "If P is a class and P has the form simple-template-id, then the transformed A can be a derived class of the deduced A." So the class Derived passed in line 9 can be deduced to its base type.
But the parameter requested by func is a template class with 1 argument, while class Base has 2(including 1 with default value), which seems incompatible.
It's interesting that gcc accepts that code under -std=c++20, but other compilers don't. It seems that more standard docs need to be consulted.
[https://timsong-cpp.github.io/cppwp/std11/temp.deduct.call#4](https://timsong-cpp.github.io/cppwp/std11/temp.deduct.call#4) says that "If P is a class and P has the form simple-template-id, then the transformed A can be a derived class of the deduced A." So the class Derived passed in line 9 can be deduced to its base type.
But the parameter requested by func is a template class with 1 argument, while class Base has 2(including 1 with default value), which seems incompatible.
It's interesting that gcc accepts that code under -std=c++20, but other compilers don't. It seems that more standard docs need to be consulted.
The following code is accepted by clang but rejected by GCC,MSVC and ICC with the option of
-std=c++11
:https://timsong-cpp.github.io/cppwp/std11/temp.deduct.call#4 says that "If P is a class and P has the form simple-template-id, then the transformed A can be a derived class of the deduced A." So the class
Derived
passed in line 9 can be deduced to its base type.But the parameter requested by
func
is a template class with 1 argument, while classBase
has 2(including 1 with default value), which seems incompatible.It's interesting that gcc accepts that code under
-std=c++20
, but other compilers don't. It seems that more standard docs need to be consulted.https://godbolt.org/z/G7fenEsYY
The text was updated successfully, but these errors were encountered: