// RUN: %clang_cc1 -fsyntax-only -std=c++17 -Wc++20-compat-pedantic -verify %s
// RUN: %clang_cc1 -fsyntax-only -std=c++20 -pedantic -verify %s
;
A a1 = ;
// expected-warning@-2 {{aggregate initialization of type 'A' with user-declared constructors is incompatible with C++20}}
// expected-error@-4 {{no matching constructor}}
A a2 = ;
;
B b1 = ; // ok
B b2 = ;
// expected-warning@-2 2{{aggregate initialization of type 'A' with user-declared constructors is incompatible with C++20}}
// expected-error@-4 2{{no viable conversion from 'int' to 'A'}}
// Essentially any use of a u8 string literal in C++<=17 is broken by C++20.
// Just warn on all such string literals.
; // expected-note 0+{{candidate}}
char u8arr = u8"hello";
const char *u8ptr = "wo" u8"rld";
string u8str = u8"test" u8"test";
// expected-warning@-4 {{type of UTF-8 string literal will change}} expected-note@-4 {{remove 'u8' prefix}}
// expected-warning@-4 {{type of UTF-8 string literal will change}} expected-note@-4 {{remove 'u8' prefix}}
// expected-warning@-4 {{type of UTF-8 string literal will change}} expected-note@-4 {{remove 'u8' prefix}}
// expected-error@-8 {{ISO C++20 does not permit initialization of char array with UTF-8 string literal}}
// expected-error@-8 {{cannot initialize a variable of type 'const char *' with an lvalue of type 'const char8_t[6]'}}
// expected-error@-8 {{no viable conversion from 'const char8_t[9]' to 'string'}}
;
// expected-warning@-3 {{this expression will be parsed as explicit(bool) in C++20}}
// expected-error@-8 {{does not refer to a value}}
// expected-error@-9 {{expected member name or ';'}}
// expected-error@-10 {{expected ')'}}
// expected-note@-12 {{declared here}}
// expected-note@-12 {{to match this '('}}
auto l = consteval ;
int ;
// expected-warning@-3 {{'consteval' is a keyword in C++20}}
// expected-error@-4 {{expected body of lambda expression}}
// expected-error@-5 {{expected unqualified-id}}