summaryrefslogtreecommitdiffstats
path: root/test/FixIt/fixit-cxx1y-compat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/FixIt/fixit-cxx1y-compat.cpp')
-rw-r--r--test/FixIt/fixit-cxx1y-compat.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/FixIt/fixit-cxx1y-compat.cpp b/test/FixIt/fixit-cxx1y-compat.cpp
new file mode 100644
index 0000000000..9fd5ff26e5
--- /dev/null
+++ b/test/FixIt/fixit-cxx1y-compat.cpp
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -verify -std=c++11 %s
+// RUN: cp %s %t
+// RUN: %clang_cc1 -x c++ -std=c++11 -fixit %t
+// RUN: %clang_cc1 -Wall -pedantic-errors -Werror -x c++ -std=c++11 %t
+// RUN: %clang_cc1 -Wall -pedantic-errors -Werror -x c++ -std=c++1y %t
+
+// This is a test of the code modification hints for C++1y-compatibility problems.
+
+struct S {
+ constexpr int &f(); // expected-warning {{'constexpr' non-static member function will not be implicitly 'const' in C++1y; add 'const' to avoid a change in behavior}}
+ int &f();
+};