使用继承构造函数时,VS2015内部编译器错误
VS2015 Internal Compiler Error when using inheriting constructors
下面是一个10行c++ 11程序,从我正在编写的程序大为简化:
template <typename T> class Base { public:
template <typename S> Base(S x) {}
};
template <typename T> class Child : public Base<T> { public:
using Base<T>::Base;
};
template <> class Child<int> : public Base<int> { public:
using Base<int>::Base;
};
int main()
{
Child<int> child(8.0f);
}
MSVC 2015输出:
1>------ Build started: Project: MyProject, Configuration: Debug Win32 ------
1> filename.cpp
1>pathtofilename(10): fatal error C1001: An internal error has occurred in the compiler.
1> (compiler file 'msc1.cpp', line 1393)
1> To work around this problem, try simplifying or changing the program near the locations listed above.
1> Please choose the Technical Support command on the Visual C++
1> Help menu, or open the Technical Support help file for more information
注意:MSVC 2015在该版本中新增了对继承构造函数的支持。
我已经提交了一个bug报告,因为至少编译器不会崩溃。但是,我可以确认这是正确的c++用法/解决方案吗?
这里有Bug报告
正如评论中提到的,这似乎是一个MSVC问题。用Clang和-std=c++11快速编译,没有问题。
相关文章:
- 将函数类成员映射到类本身内部
- 在VS2010-VS2015下编译时,如何使用decltype作为较大类型表达式的LHS
- Boost Spirit,获取迭代器内部语义动作
- 我不明白为什么我声明一个空的内部结构并将其传递给构造函数
- 内联函数中具有内部链接的全局变量
- 在函数内部的声明中初始化数组,并在外部使用它
- 如何在不知道向量大小的情况下输入向量内部的向量?
- 卷曲bracers内部结构的声明
- 从函数角度看ID到文件路径的内部与外部映射
- spdlog标头仅与外部fmt一起使用.spdlog错误:'内部':不是'fmt'
- 如何在pugixml中获取节点的内部XML
- 使用C链接在函数内部创建C++模板
- 指针没有更新它在void函数内部指向的值
- 方法内部但循环仍得到预期的不合格id错误C++
- C++:具有内部链接的正向声明常量
- SDL_PollEvent() 无法捕获类函数内部SDL_QUIT?
- 从VS 2015更新3更新到VS2015更新3 d后浮点计算行为不同的原因
- libcurl 和 DNS ttl 中的内部连接管理
- 使用继承构造函数时,VS2015内部编译器错误
- vc++ 14 (VS2015)中数组值初始化的内部编译器错误