This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55159] pythy constexpr auto lambda pointer has no initializer
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 01 Nov 2012 15:11:51 +0000
- Subject: [Bug c++/55159] pythy constexpr auto lambda pointer has no initializer
- Auto-submitted: auto-generated
- References: <bug-55159-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55159
--- Comment #3 from Daniel KrÃgler <daniel.kruegler at googlemail dot com> 2012-11-01 15:11:51 UTC ---
(In reply to comment #2)
Hmmh, it doesn't look like that one, maybe I was wrong about an existing issue.
But it seems that gcc doesn't ignore the const (in "const T*" or "const auto*")
for functions here, which seems to be the root of the second problem (This is
*not* attempting to form a function with cv-qualifier-seq). Both
template <typename T>
T* addr(T& t) { return &t; }
bool less(int x, int y) { return x < y ? x : y; }
static auto* f = addr(less);
and
template <typename T>
T* addr(T& t) { return &t; }
bool less(int x, int y) { return x < y ? x : y; }
template<typename T>
int deduce(T*) { return 0; }
int i = deduce(addr(less));
are accepted as they should.