[Bug libstdc++/61143] [4.9/4.10 Regression] Arithmetic exception on emplacing into unordered_map moved out

2014-05-13 Thread felix at fontein dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61143

--- Comment #9 from Felix Fontein  ---
Another workaround is to use reserve(), as in:

std::unordered_map b = std::move(a);
a.reserve(1); // any number > 0 will do
a.emplace(1, 1);


[Bug c++/59766] c++1y: declaring friend function with 'auto' return type deduction is rejected with bogus reason

2014-06-28 Thread felix at fontein dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59766

--- Comment #4 from Felix Fontein  ---
I can confirm this bug for GCC 4.9.0 20140604 (prerelease).


[Bug c++/61642] New: g++ confuses template member template function with template class

2014-06-28 Thread felix at fontein dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61642

Bug ID: 61642
   Summary: g++ confuses template member template function with
template class
   Product: gcc
   Version: 4.9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: felix at fontein dot de

The following code does not compile under GCC 4.9.0 20140604 (prerelease):

-8<-8<-8<-
template struct X { };

template
void fCall(Ftype & f)
{
f.template X(); // compiler stops here, confuses f's 
  // member template X with the template
  // class X defined above  
}

// To be used like this:

struct F
{
template void X() { }
};

int main()
{
F f;
fCall(f);
}
-8<-8<-8<-

The error message:

$ g++ -Wall -Wextra t2.cpp -o t2
t2.cpp: In function ‘void fCall(Ftype&)’:
t2.cpp:6:22: error: wrong number of template arguments (2, should be 1)
 f.template X();
  ^
t2.cpp:1:29: error: provided for ‘template struct X’
 template struct X { };


$ g++ -v

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /build/gcc/src/gcc-4.9-20140604/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch
--disable-libssp --enable-gnu-unique-object --enable-linker-build-id
--enable-cloog-backend=isl --disable-isl-version-check
--disable-cloog-version-check --enable-lto --enable-plugin
--enable-install-libiberty --with-linker-hash-style=gnu --disable-multilib
--disable-werror --enable-checking=release
Thread model: posix
gcc version 4.9.0 20140604 (prerelease) (GCC)