Background
Yesterday I asked a question about the guarantees of deduction guides usage in case of template template parameters. I was really surprised when Barry changed his answer to the confirmation of standard complianceness of the code. My surprise doesn't actually come from the fact deduction guides can be applied for template template parameters, but more from the standard part which conforms this compliance, namely [temp.param]/3:
A type-parameter whose identifier does not follow an ellipsis defines its identifier to be a typedef-name (if declared without
template
) or template-name (if declared withtemplate
) in the scope of the template declaration.
This plus [temp.deduct.guide]/1 and the rule for simple-template-id would allow one to create a generic deduction guide accepting any template.
Example
#include <string>
template <class T>
struct Foo {
Foo(T) { }
};
template <template <class> class TT>
TT(const char *) -> TT<std::string>;
int main() {
Foo foo("abc");
}
The question
The code causes gcc to crash with internal error and results in compilation error in clang. To be straight, I am not saying the code should be actually allowed in C++ but think the current wording does make it conformant. Am I missing some important rule that disallows the code?