// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
// RUN: %clang_cc1 -fsyntax-only -verify -pedantic -std=gnu++98 %s
// RUN: %clang_cc1 -fsyntax-only -verify -pedantic -std=gnu++11 %s
// C++-specific tests for integral constant expressions.
const int c = 10;
int ar;
;
void
int
// PR6206: out-of-line definitions are legit
// PR6373: default arguments don't count.
void
// rdar://9204520
// PR11040
const int x = 10;
int* y = reinterpret_cast<const char&>; // expected-error {{cannot initialize}}
// This isn't an integral constant expression, but make sure it folds anyway.
;
// expected-warning@-2 {{'long long' is a C++11 extension}}
int PR8836test;
// expected-warning@-1 0-1{{C99 feature}} expected-warning@-1 {{folded to constant array as an extension}}
// expected-note@-2 {{cast that performs the conversions of a reinterpret_cast is not allowed in a constant expression}}
const int nonconst = 1.0;
// expected-note@-2 {{declared here}}
int arr;
// expected-warning@-2 0-1{{C99 feature}} expected-warning@-2 {{folded to constant array as an extension}}
// expected-note@-3 {{initializer of 'nonconst' is not a constant expression}}
const int castfloat = static_cast<int>;
int arr2; // ok