public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/45523]  New: Failure to bind auto variable to function template instance
@ 2010-09-03 17:07 jewillco at osl dot iu dot edu
  2010-09-03 17:09 ` [Bug c++/45523] " jewillco at osl dot iu dot edu
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: jewillco at osl dot iu dot edu @ 2010-09-03 17:07 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 957 bytes --]

The following code:

template <typename T> void foo();
void f() {auto g = foo<int>;}

fails to compile in GCC 4.5.0's C++0x mode with the following error:

foo.cpp: In function ‘void f()’:
foo.cpp:2:20: error: ‘g’ has incomplete type

Trying different variants of this code, it appears that GCC believes that
foo<int> is an ambiguous overloaded function, while there is only one matching
function.


-- 
           Summary: Failure to bind auto variable to function template
                    instance
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jewillco at osl dot iu dot edu
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


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

* [Bug c++/45523] Failure to bind auto variable to function template instance
  2010-09-03 17:07 [Bug c++/45523] New: Failure to bind auto variable to function template instance jewillco at osl dot iu dot edu
@ 2010-09-03 17:09 ` jewillco at osl dot iu dot edu
  2010-09-03 17:11 ` [Bug c++/45523] [C++0x] " paolo dot carlini at oracle dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jewillco at osl dot iu dot edu @ 2010-09-03 17:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jewillco at osl dot iu dot edu  2010-09-03 17:08 -------
Created an attachment (id=21686)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21686&action=view)
File containing test case in error report


-- 


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


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

* [Bug c++/45523] [C++0x] Failure to bind auto variable to function template instance
  2010-09-03 17:07 [Bug c++/45523] New: Failure to bind auto variable to function template instance jewillco at osl dot iu dot edu
  2010-09-03 17:09 ` [Bug c++/45523] " jewillco at osl dot iu dot edu
@ 2010-09-03 17:11 ` paolo dot carlini at oracle dot com
  2010-09-03 19:02 ` pinskia at gmail dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-09-03 17:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from paolo dot carlini at oracle dot com  2010-09-03 17:10 -------
Let's add Jason in CC about this one too.


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu dot org
            Summary|Failure to bind auto        |[C++0x] Failure to bind auto
                   |variable to function        |variable to function
                   |template instance           |template instance


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


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

* [Bug c++/45523] [C++0x] Failure to bind auto variable to function template instance
  2010-09-03 17:07 [Bug c++/45523] New: Failure to bind auto variable to function template instance jewillco at osl dot iu dot edu
  2010-09-03 17:09 ` [Bug c++/45523] " jewillco at osl dot iu dot edu
  2010-09-03 17:11 ` [Bug c++/45523] [C++0x] " paolo dot carlini at oracle dot com
@ 2010-09-03 19:02 ` pinskia at gmail dot com
  2010-09-03 19:02 ` [Bug c++/45523] New: " Andrew Pinski
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gmail dot com @ 2010-09-03 19:02 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1453 bytes --]



------- Comment #3 from pinskia at gmail dot com  2010-09-03 19:02 -------
Subject: Re:   New: Failure to bind auto variable to function template instance

I think there is a dup of this bug without auto. Not to mention it was  
defect report against the standard.

On Sep 3, 2010, at 10:07 AM, "jewillco at osl dot iu dot edu"
<gcc-bugzilla@gcc.gnu.org 
 > wrote:

> The following code:
>
> template <typename T> void foo();
> void f() {auto g = foo<int>;}
>
> fails to compile in GCC 4.5.0's C++0x mode with the following error:
>
> foo.cpp: In function ‘void f()’:
> foo.cpp:2:20: error: ‘g’ has incomplete type
>
> Trying different variants of this code, it appears that GCC believes  
> that
> foo<int> is an ambiguous overloaded function, while there is only  
> one matching
> function.
>
>
> -- 
>           Summary: Failure to bind auto variable to function template
>                    instance
>           Product: gcc
>           Version: 4.5.0
>            Status: UNCONFIRMED
>          Severity: normal
>          Priority: P3
>         Component: c++
>        AssignedTo: unassigned at gcc dot gnu dot org
>        ReportedBy: jewillco at osl dot iu dot edu
> GCC build triplet: x86_64-unknown-linux-gnu
>  GCC host triplet: x86_64-unknown-linux-gnu
> GCC target triplet: x86_64-unknown-linux-gnu
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45523
>


-- 


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


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

* Re: [Bug c++/45523]  New: Failure to bind auto variable to function template instance
  2010-09-03 17:07 [Bug c++/45523] New: Failure to bind auto variable to function template instance jewillco at osl dot iu dot edu
                   ` (2 preceding siblings ...)
  2010-09-03 19:02 ` pinskia at gmail dot com
@ 2010-09-03 19:02 ` Andrew Pinski
  2010-09-03 19:29 ` [Bug c++/45523] [C++0x] " jewillco at osl dot iu dot edu
  2010-09-07  2:17 ` redi at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: Andrew Pinski @ 2010-09-03 19:02 UTC (permalink / raw)
  To: gcc-bugzilla; +Cc: gcc-bugs

I think there is a dup of this bug without auto. Not to mention it was  
defect report against the standard.

On Sep 3, 2010, at 10:07 AM, "jewillco at osl dot iu dot edu" <gcc-bugzilla@gcc.gnu.org 
 > wrote:

> The following code:
>
> template <typename T> void foo();
> void f() {auto g = foo<int>;}
>
> fails to compile in GCC 4.5.0's C++0x mode with the following error:
>
> foo.cpp: In function ‘void f()’:
> foo.cpp:2:20: error: ‘g’ has incomplete type
>
> Trying different variants of this code, it appears that GCC believes  
> that
> foo<int> is an ambiguous overloaded function, while there is only  
> one matching
> function.
>
>
> -- 
>           Summary: Failure to bind auto variable to function template
>                    instance
>           Product: gcc
>           Version: 4.5.0
>            Status: UNCONFIRMED
>          Severity: normal
>          Priority: P3
>         Component: c++
>        AssignedTo: unassigned at gcc dot gnu dot org
>        ReportedBy: jewillco at osl dot iu dot edu
> GCC build triplet: x86_64-unknown-linux-gnu
>  GCC host triplet: x86_64-unknown-linux-gnu
> GCC target triplet: x86_64-unknown-linux-gnu
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45523
>


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

* [Bug c++/45523] [C++0x] Failure to bind auto variable to function template instance
  2010-09-03 17:07 [Bug c++/45523] New: Failure to bind auto variable to function template instance jewillco at osl dot iu dot edu
                   ` (3 preceding siblings ...)
  2010-09-03 19:02 ` [Bug c++/45523] New: " Andrew Pinski
@ 2010-09-03 19:29 ` jewillco at osl dot iu dot edu
  2010-09-07  2:17 ` redi at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jewillco at osl dot iu dot edu @ 2010-09-03 19:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jewillco at osl dot iu dot edu  2010-09-03 19:29 -------
One thing that I forgot to mention -- the Comeau online compiler accepts this
code without any errors (just a warning about "g" being unused).


-- 


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


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

* [Bug c++/45523] [C++0x] Failure to bind auto variable to function template instance
  2010-09-03 17:07 [Bug c++/45523] New: Failure to bind auto variable to function template instance jewillco at osl dot iu dot edu
                   ` (4 preceding siblings ...)
  2010-09-03 19:29 ` [Bug c++/45523] [C++0x] " jewillco at osl dot iu dot edu
@ 2010-09-07  2:17 ` redi at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-09-07  2:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from redi at gcc dot gnu dot org  2010-09-07 02:16 -------
(In reply to comment #3)
> I think there is a dup of this bug without auto. Not to mention it was  
> defect report against the standard.

Bug 11407 / DR 115 ? That should be fixed in 4.5.0


-- 


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


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

end of thread, other threads:[~2010-09-07  2:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-03 17:07 [Bug c++/45523] New: Failure to bind auto variable to function template instance jewillco at osl dot iu dot edu
2010-09-03 17:09 ` [Bug c++/45523] " jewillco at osl dot iu dot edu
2010-09-03 17:11 ` [Bug c++/45523] [C++0x] " paolo dot carlini at oracle dot com
2010-09-03 19:02 ` pinskia at gmail dot com
2010-09-03 19:02 ` [Bug c++/45523] New: " Andrew Pinski
2010-09-03 19:29 ` [Bug c++/45523] [C++0x] " jewillco at osl dot iu dot edu
2010-09-07  2:17 ` redi at gcc dot gnu dot 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).