1 // RUN: %clang_cc1 -std=c++2a %s -include %s -verify
6 #pragma clang system_header
12 constexpr chrono::day
operator"" d(unsigned long long d
) noexcept
;
13 constexpr chrono::year
operator"" y(unsigned long long y
) noexcept
;
19 chrono::day dec_d
= 5d
;
20 chrono::day oct_d
= 05d
;
21 chrono::day bin_d
= 0b011d;
22 // expected-error@+3{{no viable conversion from 'int' to 'chrono::day'}}
23 // expected-note@9{{candidate constructor (the implicit copy constructor)}}
24 // expected-note@9{{candidate constructor (the implicit move constructor)}}
25 chrono::day hex_d
= 0x44d;
28 namespace ignore_class_udl_for_numeric_literals
{
29 struct A
{ constexpr A(const char*) {} };
30 struct B
{ constexpr B(char); };
31 struct C
{ constexpr C(int); };
32 template<A
> void operator""_a();
33 template<B
> void operator""_b();
34 template<C
> void operator""_c();
35 void test_class_udl_1() {
36 1_a
; // expected-error {{no matching}}
37 1_b
; // expected-error {{no matching}}
38 1_c
; // expected-error {{no matching}}
40 "1"_b
; // expected-error {{no matching}}
41 "1"_c
; // expected-error {{no matching}}
43 template<char...> void operator""_a();
44 template<char...> void operator""_b();
45 template<char...> void operator""_c();
46 void test_class_udl_2() {
48 // FIXME: The standard appears to say these two are ambiguous!
52 "1"_b
; // expected-error {{no matching}}
53 "1"_c
; // expected-error {{no matching}}