This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/72852] New: constexpr inside class template cannot be recognized
- From: "liweifriends at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 09 Aug 2016 12:36:22 +0000
- Subject: [Bug c++/72852] New: constexpr inside class template cannot be recognized
- Auto-submitted: auto-generated
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>