xref: /aosp_15_r20/external/clang/test/FixIt/fixit-cxx1y-compat.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -verify -std=c++11 %s
2*67e74705SXin Li // RUN: cp %s %t
3*67e74705SXin Li // RUN: %clang_cc1 -x c++ -std=c++11 -fixit %t
4*67e74705SXin Li // RUN: %clang_cc1 -Wall -pedantic-errors -Werror -x c++ -std=c++11 %t
5*67e74705SXin Li // RUN: %clang_cc1 -Wall -pedantic-errors -Werror -x c++ -std=c++1y %t
6*67e74705SXin Li 
7*67e74705SXin Li // This is a test of the code modification hints for C++1y-compatibility problems.
8*67e74705SXin Li 
9*67e74705SXin Li struct S {
10*67e74705SXin Li   constexpr int &f(); // expected-warning {{'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior}}
11*67e74705SXin Li   int &f();
12*67e74705SXin Li };
13