public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53484] New: [c++11] Wrong auto in lambdas in function templates
@ 2012-05-25 14:09 omawarisan.bokudesu at live dot jp
  2012-05-25 15:07 ` [Bug c++/53484] [4.7/4.8 Regression] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: omawarisan.bokudesu at live dot jp @ 2012-05-25 14:09 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53484
           Summary: [c++11] Wrong auto in lambdas in function templates
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: omawarisan.bokudesu@live.jp


In the following program, auto is deduced to be int&, while int is expected.

template <class T>
void f(T x){
   [&]{
       std::cout << x << std::endl;
       auto y = x;
       y = 100;
       std::cout << x << std::endl;
   }();
}

int main(){ f(0); }

output:
0
100

In non-template functions, it doesn't occur.

------------
revision r187865

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/home/user/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/home/user/gcc-trunk
--disable-bootstrap --disable-multilib --enable-languages=c,c++,fortran
--with-gmp=/home/user/gcc-trunk/src/build/backends
--with-mpfr=/home/user/gcc-trunk/src/build/backends
--with-mpc=/home/user/gcc-trunk/src/build/backends
Thread model: posix
gcc version 4.8.0 20120525 (experimental) (GCC)


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

end of thread, other threads:[~2012-06-01 18:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-25 14:09 [Bug c++/53484] New: [c++11] Wrong auto in lambdas in function templates omawarisan.bokudesu at live dot jp
2012-05-25 15:07 ` [Bug c++/53484] [4.7/4.8 Regression] " redi at gcc dot gnu.org
2012-05-29 14:32 ` rguenth at gcc dot gnu.org
2012-05-31 15:55 ` jason at gcc dot gnu.org
2012-06-01 16:55 ` jason at gcc dot gnu.org
2012-06-01 18:43 ` jason at gcc dot gnu.org
2012-06-01 18:45 ` jason at gcc dot gnu.org

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).