Skip to content

Commit 2849e45

Browse files
committed
Address comments
1 parent e0bb550 commit 2849e45

File tree

3 files changed

+38
-5
lines changed

3 files changed

+38
-5
lines changed

clang/lib/Parse/ParseDeclCXX.cpp

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1611,7 +1611,29 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
16111611
Tok.isOneOf(
16121612
#define TRANSFORM_TYPE_TRAIT_DEF(_, Trait) tok::kw___##Trait,
16131613
#include "clang/Basic/TransformTypeTraits.def"
1614-
tok::kw___is_convertible, // Last use in libc++ was removed in 925a11a
1614+
tok::kw___is_abstract,
1615+
tok::kw___is_aggregate,
1616+
tok::kw___is_arithmetic,
1617+
tok::kw___is_array,
1618+
tok::kw___is_assignable,
1619+
tok::kw___is_base_of,
1620+
tok::kw___is_bounded_array,
1621+
tok::kw___is_class,
1622+
tok::kw___is_complete_type,
1623+
tok::kw___is_compound,
1624+
tok::kw___is_const,
1625+
tok::kw___is_constructible,
1626+
tok::kw___is_convertible,
1627+
tok::kw___is_convertible_to,
1628+
tok::kw___is_destructible,
1629+
tok::kw___is_empty,
1630+
tok::kw___is_enum,
1631+
tok::kw___is_floating_point,
1632+
tok::kw___is_final,
1633+
tok::kw___is_function,
1634+
tok::kw___is_fundamental,
1635+
tok::kw___is_integral,
1636+
tok::kw___is_interface_class,
16151637
tok::kw___is_literal,
16161638
tok::kw___is_lvalue_expr,
16171639
tok::kw___is_lvalue_reference,

clang/lib/Sema/SemaChecking.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5409,14 +5409,15 @@ ExprResult Sema::ConvertVectorExpr(Expr *E, TypeSourceInfo *TInfo,
54095409
}
54105410

54115411
ExprResult Sema::BuiltinInvoke(CallExpr *TheCall) {
5412-
auto Loc = TheCall->getBeginLoc();
5412+
SourceLocation Loc = TheCall->getBeginLoc();
54135413
auto Args = MutableArrayRef(TheCall->getArgs(), TheCall->getNumArgs());
54145414
assert(llvm::none_of(Args,
54155415
[](Expr *Arg) { return Arg->isTypeDependent(); }));
54165416

54175417
if (Args.size() == 0) {
54185418
Diag(TheCall->getBeginLoc(), diag::err_typecheck_call_too_few_args_at_least)
5419-
<< 0 << 1 << 0 << 0 << TheCall->getSourceRange();
5419+
<< /*callee_type=*/0 << /*min_arg_count=*/1 << /*actual_arg_count=*/0
5420+
<< /*is_non_object=*/0 << TheCall->getSourceRange();
54205421
return ExprError();
54215422
}
54225423

@@ -5425,8 +5426,9 @@ ExprResult Sema::BuiltinInvoke(CallExpr *TheCall) {
54255426
if (auto *MPT = FuncT->getAs<MemberPointerType>()) {
54265427
if (Args.size() < 2) {
54275428
Diag(TheCall->getBeginLoc(),
5428-
diag::err_typecheck_call_too_few_args_at_least)
5429-
<< 0 << 2 << 1 << 0 << TheCall->getSourceRange();
5429+
diag::err_typecheck_call_too_few_args_at_least)
5430+
<< /*callee_type=*/0 << /*min_arg_count=*/2 << /*actual_arg_count=*/1
5431+
<< /*is_non_object=*/0 << TheCall->getSourceRange();
54305432
return ExprError();
54315433
}
54325434

clang/test/SemaCXX/builtin-invoke.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,12 @@ void test3() {
131131
__builtin_invoke(diagnose_discard); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
132132
__builtin_invoke(no_diagnose_discard);
133133
}
134+
135+
template <class T>
136+
auto test(T v) {
137+
return __builtin_invoke(v);
138+
}
139+
140+
auto call2() {
141+
test(call);
142+
}

0 commit comments

Comments
 (0)