https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97999
Bug ID: 97999
Summary: pass address of instance of function template to
another instance of the same function template with
placeholder return type
Product: gcc
Version: 10.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: spartan_117 at juno dot com
Target Milestone: ---
Created attachment 49630
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49630&action=edit
preprocessed file
version:
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-cygwin/10/lto-wrapper.exe
Target: x86_64-pc-cygwin
Configured with: /mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-10.2.0/configure
--srcdir=/mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-10.2.0 --prefix=/usr
--exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc
--docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C
--build=x86_64-pc-cygwin --host=x86_64-pc-cygwin --target=x86_64-pc-cygwin
--without-libiconv-prefix --without-libintl-prefix --libexecdir=/usr/lib
--with-gcc-major-version-only --enable-shared --enable-shared-libgcc
--enable-static --enable-version-specific-runtime-libs --enable-bootstrap
--enable-__cxa_atexit --with-dwarf2 --with-tune=generic
--enable-languages=c,c++,fortran,lto,objc,obj-c++ --enable-graphite
--enable-threads=posix --enable-libatomic --enable-libgomp --enable-libquadmath
--enable-libquadmath-support --disable-libssp --enable-libada --disable-symvers
--with-gnu-ld --with-gnu-as --with-cloog-include=/usr/include/cloog-isl
--without-libiconv-prefix --without-libintl-prefix --with-system-zlib
--enable-linker-build-id --with-default-libstdcxx-abi=gcc4-compatible
--enable-libstdcxx-filesystem-ts
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.0 (GCC)
command line:
g++ -std=c++17 bug.cc
compiler output:
bug.cc: In function 'int main()':
bug.cc:5:20: error: no matching function for call to 'yolo(<unresolved
overloaded function type>)'
5 | yolo(&yolo<int>);
| ^
bug.cc:2:13: note: candidate: 'template<class type> auto yolo(type)'
2 | static auto yolo(type) {}
| ^~~~
bug.cc:2:13: note: template argument deduction/substitution failed:
bug.cc:5:20: note: couldn't deduce template parameter 'type'
5 | yolo(&yolo<int>);
| ^
preprocessed file:
see attached "bug.ii"