public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/45080] New: [C++0x] Rejects lambda to function pointer conversion inside function template
@ 2010-07-26 14:20 piotr dot rak at gmail dot com
2010-07-26 14:21 ` [Bug c++/45080] " piotr dot rak at gmail dot com
0 siblings, 1 reply; 2+ messages in thread
From: piotr dot rak at gmail dot com @ 2010-07-26 14:20 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3654 bytes --]
cat lambda-convX.C
// { dg-options -std=c++0x }
typedef void(*pfn)();
template<int = 0>
void f1 ()
{
pfn fn = []{};
}
template<typename = int>
void f2()
{
pfn fn = []{};
}
void test()
{
f1<>();
f2<>();
}
[prak@a tmp] g++-trunk -v lambda-convX.C -c -std=c++0x
Using built-in specs.
COLLECT_GCC=/home/prak/Dev/gcc-install/bin/g++-trunk
COLLECT_LTO_WRAPPER=/home/prak/Dev/gcc-install/libexec/gcc/i686-pc-linux-gnu/4.6.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../gcc.git/configure --enable-languages=c,c++
--program-suffix=-trunk --prefix=/home/prak/Dev/gcc-install --disable-bootstrap
: (reconfigured) ../gcc.git/configure --enable-languages=c,c++
--program-suffix=-trunk --prefix=/home/prak/Dev/gcc-install --disable-bootstrap
: (reconfigured) ../gcc.git/configure --program-suffix=-trunk
--prefix=/home/prak/Dev/gcc-install --disable-bootstrap
--enable-languages=c,c++,lto --no-create --no-recursion
Thread model: posix
gcc version 4.6.0 20100725 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-v' '-c' '-std=c++0x' '-shared-libgcc' '-mtune=generic'
'-march=pentiumpro'
/home/prak/Dev/gcc-install/libexec/gcc/i686-pc-linux-gnu/4.6.0/cc1plus -quiet
-v -D_GNU_SOURCE lambda-convX.C -quiet -dumpbase lambda-convX.C -mtune=generic
-march=pentiumpro -auxbase lambda-convX -std=c++0x -version -o /tmp/ccwd0zJD.s
GNU C++ (GCC) version 4.6.0 20100725 (experimental) (i686-pc-linux-gnu)
compiled by GNU C version 4.4.4, GMP version 4.3.2, MPFR version 3.0.0,
MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/home/prak/Dev/gcc-install/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/home/prak/Dev/gcc-install/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0
/home/prak/Dev/gcc-install/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/i686-pc-linux-gnu
/home/prak/Dev/gcc-install/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/backward
/home/prak/Dev/gcc-install/include
/home/prak/Dev/gcc-install/lib/gcc/i686-pc-linux-gnu/4.6.0/include
/home/prak/Dev/gcc-install/lib/gcc/i686-pc-linux-gnu/4.6.0/include-fixed
/usr/include
End of search list.
GNU C++ (GCC) version 4.6.0 20100725 (experimental) (i686-pc-linux-gnu)
compiled by GNU C version 4.4.4, GMP version 4.3.2, MPFR version 3.0.0,
MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 4866727cef69d58d8539d96f2ebb2a27
lambda-convX.C: In function âvoid f1() [with int <anonymous> = 0]â:
lambda-convX.C:20:10: instantiated from here
lambda-convX.C:9:19: error: cannot convert âf1() [with int <anonymous> =
0]::<lambda()>â to âpfnâ in initialization
lambda-convX.C: In function âvoid f2() [with <template-parameter-1-1> =
int]â:
lambda-convX.C:21:10: instantiated from here
lambda-convX.C:15:19: error: cannot convert âf2() [with
<template-parameter-1-1> = int]::<lambda()>â to âpfnâ in initialization
--
Summary: [C++0x] Rejects lambda to function pointer conversion
inside function template
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: piotr dot rak at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45080
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/45080] [C++0x] Rejects lambda to function pointer conversion inside function template
2010-07-26 14:20 [Bug c++/45080] New: [C++0x] Rejects lambda to function pointer conversion inside function template piotr dot rak at gmail dot com
@ 2010-07-26 14:21 ` piotr dot rak at gmail dot com
0 siblings, 0 replies; 2+ messages in thread
From: piotr dot rak at gmail dot com @ 2010-07-26 14:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from piotr dot rak at gmail dot com 2010-07-26 14:21 -------
Created an attachment (id=21316)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21316&action=view)
Test case
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45080
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-07-26 14:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-26 14:20 [Bug c++/45080] New: [C++0x] Rejects lambda to function pointer conversion inside function template piotr dot rak at gmail dot com
2010-07-26 14:21 ` [Bug c++/45080] " piotr dot rak at gmail dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).