blob: 071b39c7fb39e94ecca797664ad7af8bf77c7c2f [file] [log] [blame]
Richard Smith034185c2013-04-21 01:08:50 +00001// RUN: %clang_cc1 -std=c++11 %s -verify
2// RUN: %clang_cc1 -std=c++1y %s -verify -DCXX1Y
3
4struct X {
5 constexpr int f(); // @5
6 int f(); // @6
7};
8
9#ifdef CXX1Y
10// FIXME: Detect this situation and provide a better recovery.
11
12// expected-error@6 {{class member cannot be redeclared}}
13// expected-note@5 {{previous}}
14// expected-error@6 {{non-constexpr declaration of 'f' follows constexpr declaration}}
15// expected-note@5 {{previous}}
16#else
Aaron Ballmandd69ef32014-08-19 15:55:55 +000017// expected-warning@5 {{'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior}}
Richard Smith034185c2013-04-21 01:08:50 +000018#endif