public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/43054]  New: [C++0x] ambiguous overload from identical declarations using decltype
@ 2010-02-12 15:59 redi at gcc dot gnu dot org
  2010-02-12 19:46 ` [Bug c++/43054] " jason at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-02-12 15:59 UTC (permalink / raw)
  To: gcc-bugs

template<typename R> struct future { };

#ifndef NO_PROTO
template<typename Fn, typename... Args>
 auto
 async(Fn&& fn, Args&&... args)
 -> future<decltype(fn(args...))>;
#endif

template<typename Fn, typename... Args>
 auto
 async(Fn&& fn, Args&&... args)
 -> future<decltype(fn(args...))>;

int work2(int value);

void work(int value)
{
 auto handle = async(work2, value);
}

trunk gives this error:

$ g++45 -std=c++0x -c -fmessage-length=70 pr42819.min2.cc
pr42819.min2.cc: In function 'void work(int)':
pr42819.min2.cc:19:34: error: call of overloaded 'async(int (&)(int),
   int&)' is ambiguous
pr42819.min2.cc:6:2: note: candidates are: future<decltype
   (fn(async::args ...))> async(Fn&&, Args&& ...) [with Fn = int
   (&)(int), Args = {int&}, decltype (fn(async::args ...)) = int]
pr42819.min2.cc:12:2: note:                 future<decltype
   (fn(async::args ...))> async(Fn&&, Args&& ...) [with Fn = int
   (&)(int), Args = {int&}, decltype (fn(async::args ...)) = int]
pr42819.min2.cc:19:34: error: unable to deduce 'auto' from
   '<expression error>'

The declarations are identical and the error goes away if you define NO_PROTO.


-- 
           Summary: [C++0x] ambiguous overload from identical declarations
                    using decltype
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: redi at gcc dot gnu dot org
OtherBugsDependingO 42819
             nThis:


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43054


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

* [Bug c++/43054] [C++0x] ambiguous overload from identical declarations using decltype
  2010-02-12 15:59 [Bug c++/43054] New: [C++0x] ambiguous overload from identical declarations using decltype redi at gcc dot gnu dot org
@ 2010-02-12 19:46 ` jason at gcc dot gnu dot org
  2010-02-12 20:09 ` jason at gcc dot gnu dot org
  2010-02-12 20:15 ` paolo dot carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: jason at gcc dot gnu dot org @ 2010-02-12 19:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jason at gcc dot gnu dot org  2010-02-12 19:46 -------
Subject: Bug 43054

Author: jason
Date: Fri Feb 12 19:46:29 2010
New Revision: 156737

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=156737
Log:
        PR c++/43054
        * tree.c (cp_tree_equal): Correct CALL_EXPR logic, handle
        EXPR_PACK_EXPANSION.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/variadic99.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/tree.c
    trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43054


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

* [Bug c++/43054] [C++0x] ambiguous overload from identical declarations using decltype
  2010-02-12 15:59 [Bug c++/43054] New: [C++0x] ambiguous overload from identical declarations using decltype redi at gcc dot gnu dot org
  2010-02-12 19:46 ` [Bug c++/43054] " jason at gcc dot gnu dot org
@ 2010-02-12 20:09 ` jason at gcc dot gnu dot org
  2010-02-12 20:15 ` paolo dot carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: jason at gcc dot gnu dot org @ 2010-02-12 20:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jason at gcc dot gnu dot org  2010-02-12 20:09 -------
Fixed.


-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43054


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

* [Bug c++/43054] [C++0x] ambiguous overload from identical declarations using decltype
  2010-02-12 15:59 [Bug c++/43054] New: [C++0x] ambiguous overload from identical declarations using decltype redi at gcc dot gnu dot org
  2010-02-12 19:46 ` [Bug c++/43054] " jason at gcc dot gnu dot org
  2010-02-12 20:09 ` jason at gcc dot gnu dot org
@ 2010-02-12 20:15 ` paolo dot carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-02-12 20:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from paolo dot carlini at oracle dot com  2010-02-12 20:15 -------
Many thanks Jason.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43054


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

end of thread, other threads:[~2010-02-12 20:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-12 15:59 [Bug c++/43054] New: [C++0x] ambiguous overload from identical declarations using decltype redi at gcc dot gnu dot org
2010-02-12 19:46 ` [Bug c++/43054] " jason at gcc dot gnu dot org
2010-02-12 20:09 ` jason at gcc dot gnu dot org
2010-02-12 20:15 ` paolo dot carlini at oracle dot com

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).