https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72852
Bug ID: 72852
Summary: constexpr inside class template cannot be recognized
Product: gcc
Version: 5.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: liweifriends at gmail dot com
Target Milestone: ---
The code is as follows:
#include <type_traits>
#include <iostream>
using namespace std;
template <typename T>
struct Outer
{
template <typename T2>
struct Inter
{
constexpr static bool value = std::is_same<T2, T>::value;
};
template <typename T2>
constexpr static bool value = Inter<T2>::value;
};
template <typename T1, typename T2>
struct Wrapper
{
constexpr static bool value = Outer<T1>::template value<T2>;
};
int main()
{
cerr << Wrapper<int, int>::value << endl;
}
When compile as follows:
g++ --std=c++14 ./main.cpp
Gcc reports a bug said value<T2> is not a member of Outer<int>