Wieczorek! Fixes PR8025.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118481
91177308-0d34-0410-b5e6-
96231b3b80d8
DeclarationNameInfo NameInfo = GetNameForDeclarator(D);
DeclarationName Name = NameInfo.getName();
SourceLocation Loc = NameInfo.getLoc();
+
+ // For anonymous bitfields, the location should point to the type.
+ if (Loc.isInvalid())
+ Loc = D.getSourceRange().getBegin();
+
Expr *BitWidth = static_cast<Expr*>(BW);
Expr *Init = static_cast<Expr*>(InitExpr);
__typeof__((x.x+=1)+1) y;
__typeof__(x.x<<1) y;
int y;
+
+struct PR8025 {
+ double : 2; // expected-error{{anonymous bit-field has non-integral type 'double'}}
+};