Skip to content

Commit 5e06bff

Browse files
philnik777agozillon
authored andcommitted
[Clang] Allow __is_nothrow_convertible to be used as an identifier (llvm#80476)
`__is_nothrow_convertible` has been used by libstdc++ previously as an identifier.
1 parent 72f69f8 commit 5e06bff

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

clang/lib/Parse/ParseDeclCXX.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,6 +1725,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
17251725
tok::kw___is_member_pointer,
17261726
tok::kw___is_nothrow_assignable,
17271727
tok::kw___is_nothrow_constructible,
1728+
tok::kw___is_nothrow_convertible,
17281729
tok::kw___is_nothrow_destructible,
17291730
tok::kw___is_nullptr,
17301731
tok::kw___is_object,
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=gnu++20 -fms-extensions -Wno-microsoft %s
2+
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=gnu++23 -fms-extensions -Wno-microsoft %s
3+
4+
template <class T, class U>
5+
struct Same {
6+
static constexpr auto value = __is_same(T, U);
7+
};
8+
9+
template <class T>
10+
struct __is_nothrow_convertible { // expected-warning{{keyword '__is_nothrow_convertible' will be made available as an identifier for the remainder of the translation unit}}
11+
using type = T;
12+
};
13+
14+
using A = Same<__is_nothrow_convertible<int>::type, __is_nothrow_convertible<int>::type>;

0 commit comments

Comments
 (0)