forked from OSchip/llvm-project
[clang] Fix the incorrect dependence bits for DependentExtIntType.
The error-bit was missing, and the unexpandedpack bit seemed to be set incorrectly. Reviewed By: sammccall, erichkeane Differential Revision: https://reviews.llvm.org/D83114
This commit is contained in:
parent
d3e3f36ff1
commit
cd9a241f16
|
@ -347,15 +347,7 @@ ExtIntType::ExtIntType(bool IsUnsigned, unsigned NumBits)
|
||||||
DependentExtIntType::DependentExtIntType(const ASTContext &Context,
|
DependentExtIntType::DependentExtIntType(const ASTContext &Context,
|
||||||
bool IsUnsigned, Expr *NumBitsExpr)
|
bool IsUnsigned, Expr *NumBitsExpr)
|
||||||
: Type(DependentExtInt, QualType{},
|
: Type(DependentExtInt, QualType{},
|
||||||
((NumBitsExpr->isValueDependent() || NumBitsExpr->isTypeDependent())
|
toTypeDependence(NumBitsExpr->getDependence())),
|
||||||
? TypeDependence::Dependent
|
|
||||||
: TypeDependence::None) |
|
|
||||||
(NumBitsExpr->isInstantiationDependent()
|
|
||||||
? TypeDependence::Instantiation
|
|
||||||
: TypeDependence::None) |
|
|
||||||
(NumBitsExpr->containsUnexpandedParameterPack()
|
|
||||||
? TypeDependence::VariablyModified
|
|
||||||
: TypeDependence::None)),
|
|
||||||
Context(Context), ExprAndUnsigned(NumBitsExpr, IsUnsigned) {}
|
Context(Context), ExprAndUnsigned(NumBitsExpr, IsUnsigned) {}
|
||||||
|
|
||||||
bool DependentExtIntType::isUnsigned() const {
|
bool DependentExtIntType::isUnsigned() const {
|
||||||
|
|
|
@ -32,3 +32,8 @@ struct Z {
|
||||||
int X : func<int>(); // expected-note {{in instantiation of function template}}
|
int X : func<int>(); // expected-note {{in instantiation of function template}}
|
||||||
};
|
};
|
||||||
constexpr int ssss = sizeof(Z);
|
constexpr int ssss = sizeof(Z);
|
||||||
|
|
||||||
|
struct Z2 {
|
||||||
|
int X : sizeof(_ExtInt(invalid())); // expected-error {{use of undeclared identifier}}
|
||||||
|
};
|
||||||
|
constexpr int sssss = sizeof(Z2);
|
||||||
|
|
Loading…
Reference in New Issue