diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2011-09-26 13:58:47 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2011-09-26 13:58:47 +0000 |
commit | 8fb3401bdca2d6b4f50d787f5faecf2a998535d2 (patch) | |
tree | 63855100f8caee1f9ef98899950086d453c68daf /gcc/cp | |
parent | 734e01f0a3078bd798c1f32a62632916c9929f64 (diff) | |
download | gcc-8fb3401bdca2d6b4f50d787f5faecf2a998535d2.zip gcc-8fb3401bdca2d6b4f50d787f5faecf2a998535d2.tar.gz gcc-8fb3401bdca2d6b4f50d787f5faecf2a998535d2.tar.bz2 |
pt.c (convert_nontype_argument): Handle NULLPTR_TYPE.
/cp
2011-09-26 Paolo Carlini <paolo.carlini@oracle.com>
* pt.c (convert_nontype_argument): Handle NULLPTR_TYPE.
/testsuite
2011-09-26 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/cpp0x/nullptr25.C: New.
From-SVN: r179199
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/pt.c | 10 |
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 (); |