view gcc/testsuite/g++.dg/parse/constant5.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

// { dg-options "-std=c++98 -pedantic-errors" }

enum E { 
  a = 24.2, // { dg-error "integral|constant" }
  b = (int)3.7, 
  c = int(4.2),
  d = (int)(4.2 + 3.7), // { dg-error "constant" }
  e = int(4.2 - 3.7), // { dg-error "constant" }
  f = (int)17.25
};

struct S {
  static const int i = (int)4.2;
  int j[(int)4.2];
  static const int k = static_cast<short>(3.7);
};