public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/63648] New: compile error w/ pointer argument of result_of-is_same-enable_if returns
@ 2014-10-26 10:34 shunichi_wakabayashi at yahoo dot co.jp
  2014-10-26 12:57 ` [Bug c++/63648] " shunichi_wakabayashi at yahoo dot co.jp
  2014-10-27 14:59 ` redi at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: shunichi_wakabayashi at yahoo dot co.jp @ 2014-10-26 10:34 UTC (permalink / raw)
  To: gcc-bugs

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


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

* [Bug c++/63648] compile error w/ pointer argument of result_of-is_same-enable_if returns
  2014-10-26 10:34 [Bug c++/63648] New: compile error w/ pointer argument of result_of-is_same-enable_if returns shunichi_wakabayashi at yahoo dot co.jp
@ 2014-10-26 12:57 ` shunichi_wakabayashi at yahoo dot co.jp
  2014-10-27 14:59 ` redi at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: shunichi_wakabayashi at yahoo dot co.jp @ 2014-10-26 12:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63648

--- Comment #1 from s-wakaba <shunichi_wakabayashi at yahoo dot co.jp> ---
Comment on attachment 33811
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33811
compile error with gcc 4.8.2

at line #13

typename enable_if<is_same<typename result_of<FUNC(int)>::type, int>::value,
int>::type*, // error with gcc 4.8.x
typename enable_if<is_same<typename result_of<FUNC(int)>::type, int>::value,
int>::type, // OK - not pointer
typename enable_if<is_same<typename result_of<INTFUNC(int)>::type, int>::value,
int>::type*, // OK - not template arg


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

* [Bug c++/63648] compile error w/ pointer argument of result_of-is_same-enable_if returns
  2014-10-26 10:34 [Bug c++/63648] New: compile error w/ pointer argument of result_of-is_same-enable_if returns shunichi_wakabayashi at yahoo dot co.jp
  2014-10-26 12:57 ` [Bug c++/63648] " shunichi_wakabayashi at yahoo dot co.jp
@ 2014-10-27 14:59 ` redi at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2014-10-27 14:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63648

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I think this is a duplicate of PR 23055 which was fixed for 4.9.0

*** This bug has been marked as a duplicate of bug 23055 ***


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

end of thread, other threads:[~2014-10-27 14:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-26 10:34 [Bug c++/63648] New: compile error w/ pointer argument of result_of-is_same-enable_if returns shunichi_wakabayashi at yahoo dot co.jp
2014-10-26 12:57 ` [Bug c++/63648] " shunichi_wakabayashi at yahoo dot co.jp
2014-10-27 14:59 ` redi 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).