From 090da2d1ac2e6f7c6e662888bd64f7a75aa96de5 Mon Sep 17 00:00:00 2001 From: Faisal Vali Date: Mon, 1 Jan 2018 18:23:28 +0000 Subject: Again reverting an attempt to convert the DeclSpec enums into scoped enums. - reverts r321622, r321625, and r321626. - the use of bit-fields is still resulting in warnings - even though we can use static-asserts to harden the code and ensure the bit-fields are wide enough. The bots still complain of warnings being seen. - to silence the warnings requires specifying the bit-fields with the underlying enum type (as opposed to the enum type itself), which then requires lots of unnecessary static casts of each enumerator within DeclSpec to the underlying-type, which even though could be seen as implementation details, it does hamper readability - and given the additional litterings, makes me question the value of the change. So in short - I give up (for now at least). Sorry about the noise. llvm-svn: 321628 --- clang/lib/Parse/ParseExpr.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'clang/lib/Parse/ParseExpr.cpp') diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp index 057b4e6cd5b..1b8865edb79 100644 --- a/clang/lib/Parse/ParseExpr.cpp +++ b/clang/lib/Parse/ParseExpr.cpp @@ -997,10 +997,9 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression, DS.SetRangeEnd(ILoc); const char *PrevSpec = nullptr; unsigned DiagID; - DS.SetTypeSpecType(TypeSpecifierType::TST_typename, ILoc, PrevSpec, - DiagID, Typ, + DS.SetTypeSpecType(TST_typename, ILoc, PrevSpec, DiagID, Typ, Actions.getASTContext().getPrintingPolicy()); - + Declarator DeclaratorInfo(DS, DeclaratorContext::TypeNameContext); TypeResult Ty = Actions.ActOnTypeName(getCurScope(), DeclaratorInfo); @@ -1206,8 +1205,8 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression, const char *PrevSpec = nullptr; unsigned DiagID; - DS.SetTypeSpecType(TypeSpecifierType::TST_typename, - Tok.getAnnotationEndLoc(), PrevSpec, DiagID, Type, + DS.SetTypeSpecType(TST_typename, Tok.getAnnotationEndLoc(), + PrevSpec, DiagID, Type, Actions.getASTContext().getPrintingPolicy()); Declarator DeclaratorInfo(DS, DeclaratorContext::TypeNameContext); -- cgit v1.2.3