我从 VS2013 中的 noreturn
收到一个错误 C3409: empty attribute block is not allowed
。
以下是代码片段:
#ifndef CPPX_NORETURN
# define CPPX_NORETURN [[noreturn]]
#endif
...
namespace std {
class nested_exception
{
private:
exception_ptr nested;
public:
CPPX_NORETURN // error is here
void rethrow_nested() const
{
rethrow_exception(nested);
}
有人可以帮我弄清楚如何解决这个错误吗?提前致谢。
最佳答案
VS2013 不支持 C++11 属性特性(VS2015 支持它)。
https://devblogs.microsoft.com/cppblog/c111417-features-in-vs-2015-rtm/
您可以使用 __declspec(noreturn)
代替 [[noreturn]]
。
https://msdn.microsoft.com/en-us/library/vstudio/k6ktzx3s%28v=vs.100%29.aspx
关于c++ - C3409 : empty attribute block is not allowed by noreturn,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32815196/