aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2022-08-14 15:57:38 -0400
committerNico Weber <thakis@chromium.org>2022-08-14 15:58:21 -0400
commitaacf1a9742f714dd432117d82d19a007289c3dee (patch)
treeb41c0f61e159b81a13659a8759223fcdddb04d5d /clang/lib/Parse/ParseDecl.cpp
parenta8c294d6aae340afba9347ef3d41fbb7a9ab51be (diff)
downloadllvm-aacf1a9742f714dd432117d82d19a007289c3dee.zip
llvm-aacf1a9742f714dd432117d82d19a007289c3dee.tar.gz
llvm-aacf1a9742f714dd432117d82d19a007289c3dee.tar.bz2
Revert "[clang] adds unary type transformations as compiler built-ins"
This reverts commit bc60cf2368de90918719dc7e3d7c63a72cc007ad. Doesn't build on Windows and breaks gcc 9 build, see https://reviews.llvm.org/D116203#3722094 and https://reviews.llvm.org/D116203#3722128 Also revert two follow-ups. One fixed a warning added in bc60cf2368de90918719dc7e3d7c63a72cc007ad, the other makes use of the feature added in bc60cf2368de90918719dc7e3d7c63a72cc007ad in libc++: Revert "[libcxx][NFC] utilises compiler builtins for unary transform type-traits" This reverts commit 06a1d917ef1f507aaa2f6891bb654696c866ea3a. Revert "[Sema] Fix a warning" This reverts commit c85abbe879ef3257de4db862ce249b060cc3d2a4.
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 70dd5e2..39ba93e 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -3471,8 +3471,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
// typedef-name
case tok::kw___super:
case tok::kw_decltype:
- case tok::identifier:
- ParseIdentifier: {
+ case tok::identifier: {
// This identifier can only be a typedef name if we haven't already seen
// a type-specifier. Without this check we misparse:
// typedef int X; struct Y { short X; }; as 'short int'.
@@ -3665,7 +3664,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
}
}
ConsumedEnd = Tok.getLocation();
- DS.setTypeArgumentRange(Tracker.getRange());
+ DS.setTypeofParensRange(Tracker.getRange());
// Even if something went wrong above, continue as if we've seen
// `decltype(auto)`.
isInvalid = DS.SetTypeSpecType(TST_decltype_auto, Loc, PrevSpec,
@@ -4207,13 +4206,8 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
HandlePragmaMSPointersToMembers();
continue;
-#define TRANSFORM_TYPE_TRAIT_DEF(_, Trait) case tok::kw___##Trait:
-#include "clang/Basic/TransformTypeTraits.def"
- // HACK: libstdc++ already uses '__remove_cv' as an alias template so we
- // work around this by expecting all transform type traits to be suffixed
- // with '('. They're an identifier otherwise.
- if (!MaybeParseTypeTransformTypeSpecifier(DS))
- goto ParseIdentifier;
+ case tok::kw___underlying_type:
+ ParseUnderlyingTypeSpecifier(DS);
continue;
case tok::kw__Atomic:
@@ -7451,7 +7445,7 @@ void Parser::ParseTypeofSpecifier(DeclSpec &DS) {
ExprResult Operand = Actions.CorrectDelayedTyposInExpr(
ParseExprAfterUnaryExprOrTypeTrait(OpTok, isCastExpr, CastTy, CastRange));
if (hasParens)
- DS.setTypeArgumentRange(CastRange);
+ DS.setTypeofParensRange(CastRange);
if (CastRange.getEnd().isInvalid())
// FIXME: Not accurate, the range gets one token more than it should.
@@ -7521,7 +7515,7 @@ void Parser::ParseAtomicSpecifier(DeclSpec &DS) {
if (T.getCloseLocation().isInvalid())
return;
- DS.setTypeArgumentRange(T.getRange());
+ DS.setTypeofParensRange(T.getRange());
DS.SetRangeEnd(T.getCloseLocation());
const char *PrevSpec = nullptr;