public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55853] New: [C++11] ICE calling member function of templated class in lambda
@ 2013-01-03  1:12 kyle.t.konrad at gmail dot com
  2013-01-03  1:13 ` [Bug c++/55853] " kyle.t.konrad at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: kyle.t.konrad at gmail dot com @ 2013-01-03  1:12 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55853

             Bug #: 55853
           Summary: [C++11] ICE calling member function of templated class
                    in lambda
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: kyle.t.konrad@gmail.com


Created attachment 29075
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29075
preprocessed source

This appears to be similar but not identical to
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54604.

Repro case:

#include <map>
#include <functional>

using namespace std;

struct tData {
  double a;
};

template<class DataType>
class MapWrap {
public:

  void Insert(const int& p, const DataType& data) {
    m_[p] = data;
  }

  function<void(const DataType&)> CreateInserter(function<int(const DataType&)>
data_to_int) {
    return [this, data_to_int](const DataType& data) {
Insert(data_to_int(data), data); };
  }

private:
  map<int, DataType> m_;
};

int main(int argc, char **argv) {
  MapWrap<tData> m;
  auto fn = m.CreateInserter([](const tData& d) { return static_cast<int>(d.a);
});
  fn({12});
}


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/55853] [C++11] ICE calling member function of templated class in lambda
  2013-01-03  1:12 [Bug c++/55853] New: [C++11] ICE calling member function of templated class in lambda kyle.t.konrad at gmail dot com
@ 2013-01-03  1:13 ` kyle.t.konrad at gmail dot com
  2013-01-03  1:16 ` kyle.t.konrad at gmail dot com
  2013-01-03 16:22 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: kyle.t.konrad at gmail dot com @ 2013-01-03  1:13 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55853

--- Comment #1 from Kyle Konrad <kyle.t.konrad at gmail dot com> 2013-01-03 01:13:26 UTC ---
I forgot to mention that adding "this->" to the Insert() call causes
compilation to succeed.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/55853] [C++11] ICE calling member function of templated class in lambda
  2013-01-03  1:12 [Bug c++/55853] New: [C++11] ICE calling member function of templated class in lambda kyle.t.konrad at gmail dot com
  2013-01-03  1:13 ` [Bug c++/55853] " kyle.t.konrad at gmail dot com
@ 2013-01-03  1:16 ` kyle.t.konrad at gmail dot com
  2013-01-03 16:22 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: kyle.t.konrad at gmail dot com @ 2013-01-03  1:16 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55853

--- Comment #2 from Kyle Konrad <kyle.t.konrad at gmail dot com> 2013-01-03 01:15:56 UTC ---
Version information:

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-4'
--with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs
--enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.7 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object
--enable-plugin --enable-objc-gc --with-arch-32=i586 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.2 (Debian 4.7.2-4)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/55853] [C++11] ICE calling member function of templated class in lambda
  2013-01-03  1:12 [Bug c++/55853] New: [C++11] ICE calling member function of templated class in lambda kyle.t.konrad at gmail dot com
  2013-01-03  1:13 ` [Bug c++/55853] " kyle.t.konrad at gmail dot com
  2013-01-03  1:16 ` kyle.t.konrad at gmail dot com
@ 2013-01-03 16:22 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-01-03 16:22 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55853

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |paolo.carlini at oracle dot
                   |                            |com
         Resolution|                            |DUPLICATE

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-01-03 16:21:31 UTC ---
Dup.

*** This bug has been marked as a duplicate of bug 53137 ***


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-03 16:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-03  1:12 [Bug c++/55853] New: [C++11] ICE calling member function of templated class in lambda kyle.t.konrad at gmail dot com
2013-01-03  1:13 ` [Bug c++/55853] " kyle.t.konrad at gmail dot com
2013-01-03  1:16 ` kyle.t.konrad at gmail dot com
2013-01-03 16:22 ` paolo.carlini at oracle 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).