summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/conversion/nullptr1.C
blob: 5e9767a00ee38090a3870b1ac66ca6b0e8a87f77 (plain)
1
2
3
4
5
6
7
8
9
10
/* Test for overflow in NULL pointer constant.  */
/* { dg-do compile } */

#include <limits.h>

void *p = 0;

void *q = 0 * (INT_MAX + 1);  // { dg-error "invalid conversion" }
// { dg-warning "integer overflow in expression" "" { target *-*-* } 8 }