Allow ODR for ObjC/C in the sense that we won't keep more that one definition around (merge them). However, ensure the decl pass the structural compatibility check in C11 6.2.7/1, for that, reuse the structural equivalence checks used by the ASTImporter. Few other considerations: - Create error diagnostics for tag types mismatches and thread them into the structural equivalence checks. - Note that by doing this we only support redefinition between types that are considered "compatible types" by C. This is mixed approach of the suggestions discussed in http://lists.llvm.org/pipermail/cfe-dev/2017-March/053257.html Differential Revision: https://reviews.llvm.org/D31778 rdar://problem/31909368 llvm-svn: 306918
20 lines
239 B
C
20 lines
239 B
C
struct NS {
|
|
int a;
|
|
int b;
|
|
};
|
|
|
|
enum NSE {
|
|
FST = 22,
|
|
SND = 43,
|
|
TRD = 55
|
|
};
|
|
|
|
#define NS_ENUM(_type, _name) \
|
|
enum _name : _type _name; \
|
|
enum _name : _type
|
|
|
|
typedef NS_ENUM(int, NSMyEnum) {
|
|
MinX = 11,
|
|
MinXOther = MinX,
|
|
};
|