Clang would previously assert here.
Details
Diff Detail
Event Timeline
Please take a look.
I couldn't figure out a way to get a mangled name for this without using debug info. Do you have any ideas?
lib/AST/MicrosoftMangle.cpp | ||
---|---|---|
888–891 | Thinking about it some more, it'd be better if we handled this like the else case: Name += "<unnamed-type-$S"; Name += llvm::utostr(Context.getAnonymousStructId(TD) + 1); Reason being that something like: struct S { enum {}; enum {}; }; Would otherwise end up with two identical mangles. This would also make us more consistent with other mangles, for example: enum {} x; struct {} y; These are mangled as: <unnamed-type-x> and <unnamed-type-y>. |
Thanks!
lib/AST/MicrosoftMangle.cpp | ||
---|---|---|
888–891 | Okay, yeah that makes sense. I just checked struct S { enum {}; enum {}; }; with MSVC, and they seem to give them identical mangling. I have to head out, but will update the patch tomorrow morning unless you're keen to do it :-) |
Thinking about it some more, it'd be better if we handled this like the else case:
Reason being that something like:
Would otherwise end up with two identical mangles.
This would also make us more consistent with other mangles, for example:
These are mangled as: <unnamed-type-x> and <unnamed-type-y>.