[Bug c++/54377] Consider default arguments in "wrong number of template arguments" diagnostic

2013-04-19 Thread manu at gcc dot gnu.org

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

Manuel López-Ibáñez  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2013-04-19
 CC||manu at gcc dot gnu.org
 Ever Confirmed|0   |1

--- Comment #1 from Manuel López-Ibáñez  2013-04-19 
16:32:56 UTC ---
Or say:

test.cpp: In function 'int main()':
test.cpp:6:12: error: wrong number of template arguments (1, should be at least
2)
 foo f;
 ^
test.cpp:2:8: note: provided for 'template struct foo'
 struct foo {};
^

that is, make the second message a note, mention the minimum, fix the location
to point to foo, show the default arguments in the declaration.

I would guess that counting how many are non-default is easier, but someone
will have to provide a patch.

[Bug c++/54377] Consider default arguments in "wrong number of template arguments" diagnostic

2014-08-14 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54377

--- Comment #2 from paolo at gcc dot gnu.org  ---
Author: paolo
Date: Thu Aug 14 17:00:45 2014
New Revision: 213973

URL: https://gcc.gnu.org/viewcvs?rev=213973&root=gcc&view=rev
Log:
/cp
2014-08-14  Paolo Carlini  

PR c++/54377
* pt.c (coerce_template_parms): Improve error message vs default
arguments.

/testsuite
2014-08-14  Paolo Carlini  

PR c++/54377
* g++.dg/template/pr54377.C: New.
* g++.dg/cpp0x/pr54377.C: Likewise.
* g++.dg/cpp0x/alias-decl-2.C: Adjust.
* g++.dg/cpp0x/pr51226.C: Likewise.
* g++.dg/cpp0x/variadic2.C: Likewise.
* g++.dg/parse/too-many-tmpl-args1.C: Likewise.
* g++.dg/template/dtor3.C: Likewise.
* g++.dg/template/qualttp4.C: Likewise.
* g++.dg/template/spec28.C: Likewise.
* g++.old-deja/g++.brendan/crash8.C: Likewise.
* g++.old-deja/g++.pt/ttp7.C: Likewise.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/pr54377.C
trunk/gcc/testsuite/g++.dg/template/pr54377.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/cpp0x/alias-decl-2.C
trunk/gcc/testsuite/g++.dg/cpp0x/pr51226.C
trunk/gcc/testsuite/g++.dg/cpp0x/variadic2.C
trunk/gcc/testsuite/g++.dg/parse/too-many-tmpl-args1.C
trunk/gcc/testsuite/g++.dg/template/dtor3.C
trunk/gcc/testsuite/g++.dg/template/qualttp4.C
trunk/gcc/testsuite/g++.dg/template/spec28.C
trunk/gcc/testsuite/g++.old-deja/g++.brendan/crash8.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/ttp7.C


[Bug c++/54377] Consider default arguments in "wrong number of template arguments" diagnostic

2014-08-14 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54377

Paolo Carlini  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |5.0

--- Comment #3 from Paolo Carlini  ---
Fixed for 5.0.