https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69205
Bug ID: 69205
Summary: Place a variadic temlate in front of function
parameter when it is knoen
Product: gcc
Version: c++-concepts
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: mohsen.tamiz at gmail dot com
Target Milestone: ---
Created attachment 37293
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37293&action=edit
Preprocessed file of my example.
This is the program that gives me a compile error:
#include
using namespace std;
template
void print_action(function action_factory)
{
}
int main(int argc, char *argv[])
{
print_action(function());
return 0;
}
The problem is that the compiler could not understand the place of the variadic
parameter. Some hints advised that the variadic parameters of action_factory
must be the last parameter because It is greedy and consumes all paramteres,
but I specified the Cols... explicitly in template parameter and compiler must
know that what ActionType and Cols... are and there must no deduction or
parameter guessing remained for compiler.
This is the output of command g++ -v -std=c++11 foo.cc -Wall -Wextra
-save-temps. And I attached *.i file to the bug, although, this is a minimal
testcase and it needs just header.
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
4.8.4-2ubuntu1~14.04' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs
--enable-languages=c,c++,java,go,d,\
fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared
--enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with\
-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls
--with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-gnu-uni\
que-object --disable-libmudflap --enable-plugin --with-system-zlib
--disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gc\
j-4.8-amd64/jre --enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64
--with-arch-direct\
ory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc
--enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx\
32 --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.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04)
COLLECT_GCC_OPTIONS='-v' '-std=c++11' '-Wall' '-Wextra' '-save-temps'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/4.8/cc1plus -E -quiet -v -imultiarch
x86_64-linux-gnu -D_GNU_SOURCE foo.cc -mtune=generic -march=x86-64 -std=c++11
-Wall -Wextra -fpch-preprocess\
-fstack-protector -Wformat-security -o foo.ii
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/4.8"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/c++/4.8
/usr/include/x86_64-linux-gnu/c++/4.8
/usr/include/c++/4.8/backward
/usr/lib/gcc/x86_64-linux-gnu/4.8/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-std=c++11' '-Wall' '-Wextra' '-save-temps'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/4.8/cc1plus -fpreprocessed foo.ii -quiet
-dumpbase foo.cc -mtune=generic -march=x86-64 -auxbase foo -Wall -Wextra
-std=c++11 -version -fstack-pro\
tector -Wformat-security -o foo.s
GNU C++ (Ubuntu 4.8.4-2ubuntu1~14.04) version 4.8.4 (x86_64-linux-gnu)
compiled by GNU C version 4.8.4, GMP version 5.1.3, MPFR version
3.1.2-p3, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (Ubuntu 4.8.4-2ubuntu1~14.04) version 4.8.4 (x86_64-linux-gnu)
compiled by GNU C version 4.8.4, GMP version 5.1.3, MPFR version
3.1.2-p3, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 9cb21c615435621dce26fe5e793192fd
foo.cc: In function ‘int main(int, char**)’:
foo.cc:12:69: error: no matching function for call to
‘print_action(std::functi