[Bug c++/45523] New: Failure to bind auto variable to function template instance
The following code: template typename T void foo(); void f() {auto g = fooint;} 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 fooint 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
[Bug c++/45523] Failure to bind auto variable to function template instance
--- 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=21686action=view) File containing test case in error report -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45523
[Bug c++/45523] [C++0x] Failure to bind auto variable to function template instance
--- 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
[Bug c++/45487] New: Request to change comma to semicolon in error message
When compiling a program such as: template typename T void foo(T, typename T::type c) {c.y();} struct x {typedef int type;}; void f() {foo(x(), 3);} GCC 4.5.0 (correctly) produces the error message: foo.cpp: In function void foo(T, typename T::type) [with T = x, typename T::type = int]: foo.cpp:4:21: instantiated from here foo.cpp:2:34: error: request for member y in c, which is of non-class type x::type My feature request is to have the comma between T = x and typename T::type = int replaced by a semicolon (or perhaps some other character). In larger programs, the types given in the error message often themselves contain commas, while they do not typically contain semicolons. Thus, this change would make the error messages easier to understand (and, in particular, to skim). -- Summary: Request to change comma to semicolon in error message Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: enhancement 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=45487