5
在VS2015u2下面的代码编译得很好。Visual Studio 2015 Update 3中断了构造函数属性吗?
class Foo {
public:
[[deprecated]] Foo(std::string);
Foo();
};
在VS2015u3,我得到一个错误:
C2416: attribute 'deprecated' cannot be applied in this context
这个工作在GCC 5.2,它在早期版本的VS2015的工作。当然,过时的属性并没有在VS2015中实际触发警告,但这并不是一个重要的问题。
我误解了如何将属性应用于构造函数?或者是VS2015u3在这方面打破了?
感谢您的确认并增加了详细信息。错误报告在这里:https://connect.microsoft.com/VisualStudio/feedback/details/2931827 –