This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49520] New: [C++0x] using-declaration and operator&& confuses constexpr
- 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: Fri, 24 Jun 2011 09:39:50 +0000
- Subject: [Bug c++/49520] New: [C++0x] using-declaration and operator&& confuses constexpr
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49520
Summary: [C++0x] using-declaration and operator&& confuses
constexpr
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: redi@gcc.gnu.org
CC: jason@gcc.gnu.org
namespace x { void foo(); }
template<typename T>
struct traits
{
static constexpr bool f() { return true; }
static constexpr bool g()
{
using x::foo;
return f() && noexcept(foo());
}
};
template struct traits<int>;
constexpr.cc: In static member function 'static constexpr bool traits<T>::g()
[with T = int]':
constexpr.cc:15:17: required from here
constexpr.cc:12:5: error: body of constexpr function 'static constexpr bool
traits<T>::g() [with T = int]' not a return-statement
(I'm trying to use something of this form to make vector's move-assignment
operator noexcept when using std::allocator, an important QoI issue. 'f' is
propagate_on_container_move_assignment and 'x::foo' is 'std::swap' which needs
to be called unqualified.)