aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/warn/Wconversion-real-integer-3.C
blob: a4df0100a712d80c83f00f7a86f555fb6988ca37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// { 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 behaviour 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 to .float. alters .int. constant value" }
}