// RUN: %clang_cc1 -std=c++1z -fcxx-exceptions -fexceptions -verify -DTEST=1 %s
// RUN: %clang_cc1 -std=c++1z -fcxx-exceptions -fexceptions -verify -DTEST=2 %s
// RUN: %clang_cc1 -std=c++1z -fcxx-exceptions -fexceptions -verify -DTEST=3 %s
// RUN: %clang_cc1 -std=c++1z -fcxx-exceptions -fexceptions -verify -DTEST=4 %s
// RUN: %clang_cc1 -std=c++1z -fcxx-exceptions -fexceptions -verify -DTEST=5 %s
auto test1a = ; // expected-error {{'std::source_location::__impl' was not found}}
auto test1b = ; // expected-error {{'std::source_location::__impl' was not found}}
auto test1c = ; // expected-error {{'std::source_location::__impl' was not found}}
auto test2a = ; // expected-error {{'std::source_location::__impl' was not found}}
auto test2b = ; // expected-error {{'std::source_location::__impl' must be standard-layout and have only two 'const char *' fields '_M_file_name' and '_M_function_name', and two integral fields '_M_line' and '_M_column'}}
auto test3 = ; // expected-error {{'std::source_location::__impl' must be standard-layout and have only two 'const char *' fields '_M_file_name' and '_M_function_name', and two integral fields '_M_line' and '_M_column'}}
auto test4 = ; // expected-error {{'std::source_location::__impl' must be standard-layout and have only two 'const char *' fields '_M_file_name' and '_M_function_name', and two integral fields '_M_line' and '_M_column'}}
// Verify that the address cannot be used as a non-type template argument.
auto // expected-note {{candidate template ignored: substitution failure: non-type template argument does not refer to any declaration}}
auto test5a = fn1<>; // expected-error {{no matching function for call to 'fn1'}}
// (But using integer subobjects by value is okay.)
auto
auto test5b = fn2<>;
// While it's not semantically required, for efficiency, we ensure that two
// source-locations with the same content will point to the same object. Given
// the odd definition of the struct used here (using 'signed char'), any
// line-number modulo 256 will thus have the same content, and be deduplicated.
constexpr auto sl1 = ;
constexpr auto sl2 = ;
constexpr auto sl3 = ;
static_assert;
static_assert;
static_assert;