This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/78022] constexpr int template rejected unless constructor is used before hand
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 12 Feb 2018 14:21:52 +0000
- Subject: [Bug c++/78022] constexpr int template rejected unless constructor is used before hand
- Auto-submitted: auto-generated
- References: <bug-78022-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78022
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2016-10-19 00:00:00 |2018-2-12
Known to fail| |8.0
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Still fails on trunk (and Clang-5+ as reported). Clang-4 and EDG 4.14 accept
it.
Slightly reduced:
template<typename T>
struct A
{
template<typename... Args>
constexpr A(Args&&...){}
};
struct B : public A<int>
{
using A<int>::A;
};
// Uncommenting the following line makes this file compile.
//constexpr B p{0};
// Commenting the following line makes this file compile.
template<typename>
struct X
{
X()
{
// The following line is fine.
const B b0{0};
// The following line produces an error.
constexpr B b1{0};
}
};