зеркало из https://github.com/microsoft/clang.git
The integer type of an enumeration type isn't always canonical
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139334 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
5330ee0717
Коммит
69ff26bd1e
|
@ -2597,7 +2597,7 @@ struct IntRange {
|
|||
if (const ComplexType *CT = dyn_cast<ComplexType>(T))
|
||||
T = CT->getElementType().getTypePtr();
|
||||
if (const EnumType *ET = dyn_cast<EnumType>(T))
|
||||
T = ET->getDecl()->getIntegerType().getTypePtr();
|
||||
T = C.getCanonicalType(ET->getDecl()->getIntegerType()).getTypePtr();
|
||||
|
||||
const BuiltinType *BT = cast<BuiltinType>(T);
|
||||
assert(BT->isInteger());
|
||||
|
|
|
@ -20,3 +20,8 @@ struct X {
|
|||
enum Other : Integer field3 : 4;
|
||||
enum : Integer { Blah, Blarg } field4 : 4;
|
||||
};
|
||||
|
||||
void test() {
|
||||
long value = 2;
|
||||
Enumeration e = value;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче