This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/63648] New: compile error w/ pointer argument of result_of-is_same-enable_if returns
- From: "shunichi_wakabayashi at yahoo dot co.jp" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 26 Oct 2014 10:24:52 +0000
- Subject: [Bug c++/63648] New: compile error w/ pointer argument of result_of-is_same-enable_if returns
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63648
Bug ID: 63648
Summary: compile error w/ pointer argument of
result_of-is_same-enable_if returns
Product: gcc
Version: 4.8.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: shunichi_wakabayashi at yahoo dot co.jp
Created attachment 33811
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33811&action=edit
compile error with gcc 4.8.2
As my attached file, declaration of template functions with pointer arguments
indicate to result-type of specific type_traits functions like,
enable_if<is_same<result_of<TEMPLATE_ARG()>::type>, any_type>::value,
int>::type*
can trigger compile error with following messages,
> prog.cc:20:5: error: no matching function for call to 'invoke_func'
> invoke_func(0, retint);
> ^~~~~~~~~~~
> prog.cc:12:30: note: candidate template ignored: substitution failure [with FUNC = int (*)(int)]
> template<typename FUNC> void invoke_func(
the error could be resolved if changing TEMPLATE_ARG to NON_TEMPLATE_ARG or
pointer to normal value or moving enable_if<...> trick to outside of function
arguments declaration (e.g. auto funcname(...) -> enable_if<...>::type)
for example, when changing line #13 to like follows, the error disappears:
typename enable_if<is_integral<typename
result_of<INTFUNC(int)>::type>::value>::type*, // not template arg
or
typename enable_if<is_integral<typename
result_of<FUNC(int)>::type>::value>::type, // not pointer
this problem cannot be occurred with gcc 4.9.x
is it a known bug?
thanks