使用LLVM 5在objective-c中的结构中声明枚举



在objective-c文件的结构中声明枚举时出错。我最近升级到LLVM 5,以前没有出现过这个错误。我试过C99和C11。有什么想法吗?或者这是以前允许的非法语法吗?

struct LogParams
{
    typedef NS_ENUM (int, Level)    // Error type name does not allow storage class to be specified
    {
        LevelTrace = 0,
        LevelDebug,
        LevelInfo,
        LevelWarn,
        LevelError,
        LevelFatal
    };
    uint64_t time;
};

在结构中声明枚举或typedef在C++和Objective-C++翻译中是有效的。

它在C或Objective-C中是不合法的

最新更新