1 // Tests that the compiler won't crash due to the consteval constructor.
3 // REQUIRES: x86-registered-target
7 // RUN: split-file %s %t
9 // RUN: %clang_cc1 -triple=x86_64-linux-gnu -std=c++20 -emit-module-interface %t/m.cppm -o %t/m.pcm
10 // RUN: %clang_cc1 -triple=x86_64-linux-gnu -std=c++20 %t/m.pcm -emit-llvm -o - | FileCheck %t/m.cppm
15 export module mymodule;
17 // CHECK: @.str = {{.*}}"{}\00"
18 // CHECK: store{{.*}}ptr @.str
23 template<class _CharT>
24 class basic_string_view {
26 constexpr basic_string_view(const _CharT* __s)
30 const _CharT* __data_;
33 template <class _CharT>
34 struct basic_format_string {
36 consteval basic_format_string(const _Tp& __str) : __str_{__str} {
40 basic_string_view<_CharT> __str_;
44 auto this_fails() -> void {
45 std::basic_format_string<char> __fmt("{}");