mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-27 23:51:56 +00:00
Properly handle non-canonical underlying types in
ASTContext::getUnaryTransformType. This can happen if, for example, an enumeration's underlying type is a typedef. llvm-svn: 152031
This commit is contained in:
parent
b3ec7308b0
commit
15d48ec46f
@ -2962,7 +2962,7 @@ QualType ASTContext::getUnaryTransformType(QualType BaseType,
|
||||
new (*this, TypeAlignment) UnaryTransformType (BaseType, UnderlyingType,
|
||||
Kind,
|
||||
UnderlyingType->isDependentType() ?
|
||||
QualType() : UnderlyingType);
|
||||
QualType() : getCanonicalType(UnderlyingType));
|
||||
Types.push_back(Ty);
|
||||
return QualType(Ty, 0);
|
||||
}
|
||||
|
@ -35,3 +35,9 @@ static_assert(is_same_type<underlying_type<f>::type, char>::value,
|
||||
"f has the wrong underlying type in the template");
|
||||
|
||||
underlying_type<int>::type e; // expected-note {{requested here}}
|
||||
|
||||
using uint = unsigned;
|
||||
enum class foo : uint { bar };
|
||||
|
||||
static_assert(is_same_type<underlying_type<foo>::type, unsigned>::value,
|
||||
"foo has the wrong underlying type");
|
||||
|
Loading…
Reference in New Issue
Block a user