【发布时间】:2013-07-13 10:28:20
【问题描述】:
在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 的 Objective-C++ 文件中。
标签: objective-c c struct enums llvm