Mark constexpr methods as const, to silence a MSVC warning.
Also re-enable that warning on GCC/Clang, now that it has been addressed.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 80290ab..3c30419 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -44,7 +44,7 @@
endif()
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "^(GNU|Clang|Intel|AppleClang)$")
- set(FRUIT_ADDITIONAL_COMPILE_FLAGS "${FRUIT_ADDITIONAL_COMPILE_FLAGS} -std=c++11 -W -Wall -Wno-constexpr-not-const -Wno-unknown-warning-option -Wno-missing-braces")
+ set(FRUIT_ADDITIONAL_COMPILE_FLAGS "${FRUIT_ADDITIONAL_COMPILE_FLAGS} -std=c++11 -W -Wall -Wno-unknown-warning-option -Wno-missing-braces")
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "^(MSVC)$")
# TODO: we currently disable the warning C4709 because MSVC emits it even when there is no reason to. Re-enable it when possible.
set(FRUIT_ADDITIONAL_COMPILE_FLAGS "${FRUIT_ADDITIONAL_COMPILE_FLAGS} /nologo /FS /W4 /wd4324 /wd4709 /wd4459 /D_SCL_SECURE_NO_WARNINGS")
diff --git a/include/fruit/impl/util/type_info.defn.h b/include/fruit/impl/util/type_info.defn.h
index e0f86c5..b0c0728 100644
--- a/include/fruit/impl/util/type_info.defn.h
+++ b/include/fruit/impl/util/type_info.defn.h
@@ -28,7 +28,7 @@
template <typename T, bool is_abstract = std::is_abstract<T>::value>
struct GetConcreteTypeInfo {
- constexpr TypeInfo::ConcreteTypeInfo operator()() {
+ constexpr TypeInfo::ConcreteTypeInfo operator()() const {
return TypeInfo::ConcreteTypeInfo{
sizeof(T),
alignof(T),
@@ -45,7 +45,7 @@
// when T is an abstract type.
template <typename T>
struct GetConcreteTypeInfo<T, true> {
- constexpr TypeInfo::ConcreteTypeInfo operator()() {
+ constexpr TypeInfo::ConcreteTypeInfo operator()() const {
return TypeInfo::ConcreteTypeInfo{
0 /* type_size */,
0 /* type_alignment */,