forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Clang] Allow __is_nothrow_convertible to be used as an identifier (l…
…lvm#80476) `__is_nothrow_convertible` has been used by libstdc++ previously as an identifier.
- Loading branch information
1 parent
72f69f8
commit 5e06bff
Showing
2 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
clang/test/SemaCXX/libstdcxx_is_nothrow_convertible_hack.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=gnu++20 -fms-extensions -Wno-microsoft %s | ||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=gnu++23 -fms-extensions -Wno-microsoft %s | ||
|
||
template <class T, class U> | ||
struct Same { | ||
static constexpr auto value = __is_same(T, U); | ||
}; | ||
|
||
template <class T> | ||
struct __is_nothrow_convertible { // expected-warning{{keyword '__is_nothrow_convertible' will be made available as an identifier for the remainder of the translation unit}} | ||
using type = T; | ||
}; | ||
|
||
using A = Same<__is_nothrow_convertible<int>::type, __is_nothrow_convertible<int>::type>; |