view gcc/testsuite/g++.dg/warn/Wconversion-real-integer-3.C @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

// { dg-do compile }
// { dg-options "-Wconversion -ftrack-macro-expansion=2" }
// { dg-require-effective-target int32plus }

#include "conversion-real-integer-3.h"

float  vfloat;

void h (void)
{
    // We want to trigger an error on the token INT_MAX below, that is
    // a macro that expands to the built-in __INT_MAX__.  Furthermore,
    // INT_MAX is defined inside a system header.
    //
    // The behavior we want is that the diagnostic should point to
    // the locus that inside the source code here, at the relevant
    // line below, even with -ftrack-macro-expansion.  We don't want
    // it to point to the any locus that is inside the system header.
    vfloat = INT_MAX; // { dg-warning "conversion from .int. to .float. changes value from .2147483647. to " }
}