bit-field width nor the initializer value are type- or
value-dependent. Fixes PR8712.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124866
91177308-0d34-0410-b5e6-
96231b3b80d8
if (Bitfield->getType()->isBooleanType())
return false;
+ // Ignore value- or type-dependent expressions.
+ if (Bitfield->getBitWidth()->isValueDependent() ||
+ Bitfield->getBitWidth()->isTypeDependent() ||
+ Init->isValueDependent() ||
+ Init->isTypeDependent())
+ return false;
+
Expr *OriginalInit = Init->IgnoreParenImpCasts();
llvm::APSInt Width(32);
A<int> ai; // expected-note{{in instantiation of}}
}
+
+namespace PR8712 {
+ template <int dim>
+ class B {
+ public:
+ B(const unsigned char i);
+ unsigned char value : (dim > 0 ? dim : 1);
+ };
+
+ template <int dim>
+ inline B<dim>::B(const unsigned char i) : value(i) {}
+}