// RUN: %clang_cc1 -std=c++11 %s -verify -triple x86_64-linux-gnu
;
;
constexpr std::nullptr_t
constexpr std::nullptr_t np = nullptr;
std::nullptr_t nonconst_np; // expected-note{{declared here}}
thread_local int tl; // expected-note {{refers here}}
IP<0> ip0; // expected-error{{null non-type template argument must be cast to template parameter type 'int *'}}
IP<> ip1; // expected-error{{null non-type template argument must be cast to template parameter type 'int *'}}
IP<nullptr> ip2;
IP<get_nullptr> ip3;
IP<0> ip4;
IP<np> ip5;
IP<nonconst_np> ip5; // expected-error{{non-type template argument of type 'std::nullptr_t' is not a constant expression}} \
// expected-note{{read of non-constexpr variable 'nonconst_np' is not allowed in a constant expression}}
IP<0> ip6; // expected-error{{null non-type template argument of type 'float *' does not match template parameter of type 'int *'}}
IP<&tl> ip7; // expected-error{{non-type template argument of type 'int *' is not a constant expression}}
IR<tl> ir1; // expected-error{{non-type template argument refers to thread-local object}}
;
;
PM<0> pm0; // expected-error{{null non-type template argument must be cast to template parameter type 'int X::*'}}
PM<> pm1; // expected-error{{null non-type template argument must be cast to template parameter type 'int X::*'}}
PM<nullptr> pm2;
PM<get_nullptr> pm3;
PM<0> pm4;
PM<np> pm5;
;
PMF<0> pmf0; // expected-error{{null non-type template argument must be cast to template parameter type 'int (X::*)(int)'}}
PMF<> pmf1; // expected-error{{null non-type template argument must be cast to template parameter type 'int (X::*)(int)'}}
PMF<nullptr> pmf2;
PMF<get_nullptr> pmf3;
PMF<0> pmf4;
PMF<np> pmf5;
;
NP<nullptr> np1;
NP<np> np2;
NP<get_nullptr> np3;
NP<0> np4; // expected-error{{null non-type template argument must be cast to template parameter type 'std::nullptr_t'}}
constexpr int i = 7;
NP<i> np5; // expected-error{{non-type template argument of type 'const int' cannot be converted to a value of type 'std::nullptr_t'}}