mirror of git://gcc.gnu.org/git/gcc.git
re PR c++/63757 (nullptr conversion sequence fails to compile)
/cp 2014-11-26 Paolo Carlini <paolo.carlini@oracle.com> PR c++/63757 * call.c (standard_conversion): Do not require expr to be non-null when NULLPTR_TYPE_P (from) is true. /testsuite 2014-11-26 Paolo Carlini <paolo.carlini@oracle.com> PR c++/63757 * g++.dg/cpp0x/nullptr33.C: New. From-SVN: r218098
This commit is contained in:
parent
4bb0ca2d1e
commit
2ad2e0afc6
|
|
@ -1,3 +1,9 @@
|
|||
2014-11-26 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/63757
|
||||
* call.c (standard_conversion): Do not require expr to be non-null
|
||||
when NULLPTR_TYPE_P (from) is true.
|
||||
|
||||
2014-11-26 Jason Merrill <jason@redhat.com>
|
||||
|
||||
* constexpr.c (cxx_eval_constant_expression) [SAVE_EXPR]: Avoid
|
||||
|
|
|
|||
|
|
@ -1194,7 +1194,8 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
|
|||
rvalue of type std::nullptr_t. */
|
||||
if ((tcode == POINTER_TYPE || TYPE_PTRMEM_P (to)
|
||||
|| NULLPTR_TYPE_P (to))
|
||||
&& expr && null_ptr_cst_p (expr))
|
||||
&& ((expr && null_ptr_cst_p (expr))
|
||||
|| NULLPTR_TYPE_P (from)))
|
||||
conv = build_conv (ck_std, to, conv);
|
||||
else if ((tcode == INTEGER_TYPE && fcode == POINTER_TYPE)
|
||||
|| (tcode == POINTER_TYPE && fcode == INTEGER_TYPE))
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
2014-11-26 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/63757
|
||||
* g++.dg/cpp0x/nullptr33.C: New.
|
||||
|
||||
2014-11-26 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* lib/tsan-dg.exp (check_effective_target_fsanitize_thread,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
// PR c++/63757
|
||||
// { dg-do compile { target c++11 } }
|
||||
|
||||
typedef decltype(nullptr) nullptr_t;
|
||||
|
||||
void bar(void*) {}
|
||||
|
||||
struct foo
|
||||
{
|
||||
operator nullptr_t()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
bar(foo());
|
||||
}
|
||||
Loading…
Reference in New Issue