From c8cef5c2f223062340bad0c983d475bf418b1907 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 7 Jun 2019 08:24:25 +0100 Subject: [PATCH] Fix constexpr-not-const clang warning in testcase 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Werror,-Wconstexpr-not-const] --- Examples/test-suite/cpp11_template_typedefs.i | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Examples/test-suite/cpp11_template_typedefs.i b/Examples/test-suite/cpp11_template_typedefs.i index 02cb8ac30..5f1f2e6f9 100644 --- a/Examples/test-suite/cpp11_template_typedefs.i +++ b/Examples/test-suite/cpp11_template_typedefs.i @@ -15,7 +15,7 @@ public: using type2_t = T2; T1 a; T2 b; - constexpr int get_n() { return N; } + constexpr int get_n() const { return N; } }; // Specialization for T1=const char*, T2=bool @@ -26,7 +26,7 @@ public: using type2_t = bool; type1_t a; type2_t b; - constexpr int get_n() { return 3 * N; } + constexpr int get_n() const { return 3 * N; } }; // alias templates