clang++ - treat template class name as template in the class scope

后端 未结 2 1954
谎友^
谎友^ 2021-01-19 09:44

It seems that clang++ (I tried clang 3.2) treats the name of a template class as a instantiated class, not a template for any occurence within the class scope. For example,

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-19 09:50

    This is nonconformant behavior as of C++11 because C++11 says that the injected class name (which is a name automatically declared within the class body) is a template when it is passed to a template template parameter. So your code should only fail in a C++03 implementation.

    However there is no need to open a bug report about this now. I have already done it way back.

提交回复
热议问题