diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0dd01d95d43..8ec7a054e38 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2011-09-22 Paolo Carlini + + PR c++/50371 + * pt.c (invalid_nontype_parm_type_p): Handle NULLPTR_TYPE. + 2011-09-22 Jonathan Wakely Paolo Carlini diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index ee33daf1fb9..af5ca5cee84 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -18717,6 +18717,8 @@ invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain) return 0; else if (TREE_CODE (type) == DECLTYPE_TYPE) return 0; + else if (TREE_CODE (type) == NULLPTR_TYPE) + return 0; if (complain & tf_error) error ("%q#T is not a valid type for a template constant parameter", type); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b9d638ff879..90fe9360759 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-09-22 Paolo Carlini + + PR c++/50371 + * g++.dg/cpp0x/nullptr24.C: New. + 2011-09-22 Uros Bizjak PR target/50482 diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr24.C b/gcc/testsuite/g++.dg/cpp0x/nullptr24.C new file mode 100644 index 00000000000..f3917796627 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/nullptr24.C @@ -0,0 +1,5 @@ +// PR c++/50371 +// { dg-options -std=c++0x } + +template +struct nt;