Skip to content

Commit 8e56a50

Browse files
committed
add test for GH56652
1 parent dcd9853 commit 8e56a50

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ Bug Fixes in This Version
379379
- Fixed an assertion when an improper use of the ``malloc`` attribute targeting
380380
a function without arguments caused us to try to access a non-existent argument.
381381
(#GH159080)
382-
- Fixed a failed assertion with empty filename arguments in ``__has_embed``. (#GH159898)
382+
- Fixed a failed assertion with empty filename arguments in ``__has_embed``. (#GH159898) (#GH56652)
383383

384384
Bug Fixes to Compiler Builtins
385385
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

clang/test/CodeGenCXX/gh56652.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// RUN: %clang_cc1 -std=c++20 -triple x86_64-elf-gnu %s -emit-llvm -o - | FileCheck %s
2+
3+
namespace GH56652{
4+
5+
struct foo {};
6+
7+
template <typename T> struct bar {
8+
using type = T;
9+
10+
template <foo> inline static constexpr auto b = true;
11+
};
12+
13+
template <typename T>
14+
concept C = requires(T a) { T::template b<foo{}>; };
15+
16+
template <typename T> auto fn(T) {
17+
if constexpr (!C<T>)
18+
return foo{};
19+
else
20+
return T{};
21+
}
22+
23+
auto a = decltype(fn(bar<int>{})){};
24+
25+
}
26+
27+
// CHECK: %"struct.GH56652::bar" = type { i8 }
28+
// CHECK: @_ZN7GH566521aE = global %"struct.GH56652::bar" undef

0 commit comments

Comments
 (0)