aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/pt.c10
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index eb870c7..fe7589e9 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2011-09-26 Paolo Carlini <paolo.carlini@oracle.com>
+ * pt.c (convert_nontype_argument): Handle NULLPTR_TYPE.
+
+2011-09-26 Paolo Carlini <paolo.carlini@oracle.com>
+
PR c++/26747
* cp-gimplify.c (get_bc_label): Remove obsolete diagnostics.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index ebadebf..2c398e0 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -5951,6 +5951,16 @@ convert_nontype_argument (tree type, tree expr, tsubst_flags_t complain)
if (expr == error_mark_node)
return expr;
}
+ else if (NULLPTR_TYPE_P (type))
+ {
+ if (expr != nullptr_node)
+ {
+ error ("%qE is not a valid template argument for type %qT "
+ "because it is of type %qT", expr, type, TREE_TYPE (expr));
+ return NULL_TREE;
+ }
+ return expr;
+ }
/* A template non-type parameter must be one of the above. */
else
gcc_unreachable ();