public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/19499] New: [3.4/4.0 regression] Bad diagnostic for namespace as template parameter
@ 2005-01-18 9:15 reichelt at gcc dot gnu dot org
2005-01-18 9:23 ` [Bug c++/19499] " reichelt at gcc dot gnu dot org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-01-18 9:15 UTC (permalink / raw)
To: gcc-bugs
The diagnostic for the following invalid code snippet could be improved:
=================================
template<typename> struct A {};
namespace N {}
A<N> a;
=================================
On mainline we now get:
bug5.cc:5: error: template argument 1 is invalid
bug5.cc:5: error: template argument 1 is invalid
bug5.cc:5: error: template argument 1 is invalid
bug5.cc:5: error: template argument 1 is invalid
bug5.cc:5: error: template argument 1 is invalid
bug5.cc:5: error: template argument 1 is invalid
bug5.cc:5: error: template argument 1 is invalid
bug5.cc:5: error: template argument 1 is invalid
bug5.cc:5: error: expected constructor, destructor, or type conversion before
'<' token
With 3.3.5 we get:
bug5.cc:5: error: use of namespace `N' as expression
bug5.cc:5: error: template argument 1 is invalid
bug5.cc:5: error: ISO C++ forbids declaration of `a' with no type
which is okay IMHO. With 3.4.3 we get
bug5.cc:5: error: template argument 1 is invalid
bug5.cc:5: error: invalid type in declaration before ';' token
which is less informative, but still okay.
With the current 3.4 branch we almost get the same mess as with mainline.
--
Summary: [3.4/4.0 regression] Bad diagnostic for namespace as
template parameter
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: diagnostic, monitored
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19499
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/19499] [3.4/4.0 regression] Bad diagnostic for namespace as template parameter
2005-01-18 9:15 [Bug c++/19499] New: [3.4/4.0 regression] Bad diagnostic for namespace as template parameter reichelt at gcc dot gnu dot org
@ 2005-01-18 9:23 ` reichelt at gcc dot gnu dot org
2005-01-18 14:39 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-01-18 9:23 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2005-01-18 09:23 -------
Alexandre, this was probably caused by your patch for PR18757:
http://gcc.gnu.org/ml/gcc-cvs/2004-12/msg00382.html
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |aoliva at gcc dot gnu dot
| |org
Target Milestone|--- |3.4.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19499
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/19499] [3.4/4.0 regression] Bad diagnostic for namespace as template parameter
2005-01-18 9:15 [Bug c++/19499] New: [3.4/4.0 regression] Bad diagnostic for namespace as template parameter reichelt at gcc dot gnu dot org
2005-01-18 9:23 ` [Bug c++/19499] " reichelt at gcc dot gnu dot org
@ 2005-01-18 14:39 ` pinskia at gcc dot gnu dot org
2005-01-31 6:26 ` mmitchel at gcc dot gnu dot org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-18 14:39 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-18 14:30 -------
Confirmed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-01-18 14:30:57
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19499
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/19499] [3.4/4.0 regression] Bad diagnostic for namespace as template parameter
2005-01-18 9:15 [Bug c++/19499] New: [3.4/4.0 regression] Bad diagnostic for namespace as template parameter reichelt at gcc dot gnu dot org
2005-01-18 9:23 ` [Bug c++/19499] " reichelt at gcc dot gnu dot org
2005-01-18 14:39 ` pinskia at gcc dot gnu dot org
@ 2005-01-31 6:26 ` mmitchel at gcc dot gnu dot org
2005-02-01 5:57 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-01-31 6:26 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2005-01-31 06:26 -------
Alexandre, this patch was clearly incorrect. The whole reason to create
CPP_TEMPLATE_ID tokens is to avoid re-parsing the same token sequence in the
case that an error occurred. Please revert this patch ASAP.
Feel free to assign the original bug which your patch fixed to me.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19499
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/19499] [3.4/4.0 regression] Bad diagnostic for namespace as template parameter
2005-01-18 9:15 [Bug c++/19499] New: [3.4/4.0 regression] Bad diagnostic for namespace as template parameter reichelt at gcc dot gnu dot org
` (2 preceding siblings ...)
2005-01-31 6:26 ` mmitchel at gcc dot gnu dot org
@ 2005-02-01 5:57 ` cvs-commit at gcc dot gnu dot org
2005-02-01 7:04 ` cvs-commit at gcc dot gnu dot org
2005-02-01 10:50 ` giovannibajo at libero dot it
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-02-01 5:57 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-02-01 05:56 -------
Subject: Bug 19499
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: aoliva@gcc.gnu.org 2005-02-01 05:56:08
Modified files:
gcc/testsuite : ChangeLog
gcc/cp : ChangeLog parser.c pt.c
gcc/testsuite/g++.dg/parse: typename7.C
Log message:
gcc/cp/ChangeLog:
PR c++/18757
PR c++/19366
PR c++/19499
* parser.c (cp_parser_template_id): Revert 2004-12-09's patch.
Issue an error when creating the template id.
* pt.c (fn_type_unification): Return early if the explicit
template arg list is an error_mark_node.
gcc/testsuite/ChangeLog:
* g++.dg/parse/typename7.C: Adjust error messages.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4967&r2=1.4968
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4607&r2=1.4608
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.306&r2=1.307
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.970&r2=1.971
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/typename7.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19499
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/19499] [3.4/4.0 regression] Bad diagnostic for namespace as template parameter
2005-01-18 9:15 [Bug c++/19499] New: [3.4/4.0 regression] Bad diagnostic for namespace as template parameter reichelt at gcc dot gnu dot org
` (3 preceding siblings ...)
2005-02-01 5:57 ` cvs-commit at gcc dot gnu dot org
@ 2005-02-01 7:04 ` cvs-commit at gcc dot gnu dot org
2005-02-01 10:50 ` giovannibajo at libero dot it
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-02-01 7:04 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-02-01 07:04 -------
Subject: Bug 19499
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-3_4-branch
Changes by: aoliva@gcc.gnu.org 2005-02-01 07:04:01
Modified files:
gcc/testsuite : ChangeLog
gcc/cp : ChangeLog parser.c pt.c
gcc/testsuite/g++.dg/parse: typename7.C
Log message:
gcc/cp/ChangeLog:
PR c++/18757
PR c++/19366
PR c++/19499
* parser.c (cp_parser_template_id): Revert 2004-12-09's patch.
Issue an error when creating the template id.
* pt.c (fn_type_unification): Return early if the explicit
template arg list is an error_mark_node.
gcc/testsuite/ChangeLog:
* g++.dg/parse/typename7.C: Adjust error messages.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.354&r2=1.3389.2.355
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.193&r2=1.3892.2.194
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.157.2.50&r2=1.157.2.51
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.816.2.49&r2=1.816.2.50
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/typename7.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.1.10.1&r2=1.1.10.2
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19499
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/19499] [3.4/4.0 regression] Bad diagnostic for namespace as template parameter
2005-01-18 9:15 [Bug c++/19499] New: [3.4/4.0 regression] Bad diagnostic for namespace as template parameter reichelt at gcc dot gnu dot org
` (4 preceding siblings ...)
2005-02-01 7:04 ` cvs-commit at gcc dot gnu dot org
@ 2005-02-01 10:50 ` giovannibajo at libero dot it
5 siblings, 0 replies; 7+ messages in thread
From: giovannibajo at libero dot it @ 2005-02-01 10:50 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2005-02-01 10:49 -------
Fixed in 3.4.4 and 4.0.0.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19499
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2005-02-01 10:50 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-18 9:15 [Bug c++/19499] New: [3.4/4.0 regression] Bad diagnostic for namespace as template parameter reichelt at gcc dot gnu dot org
2005-01-18 9:23 ` [Bug c++/19499] " reichelt at gcc dot gnu dot org
2005-01-18 14:39 ` pinskia at gcc dot gnu dot org
2005-01-31 6:26 ` mmitchel at gcc dot gnu dot org
2005-02-01 5:57 ` cvs-commit at gcc dot gnu dot org
2005-02-01 7:04 ` cvs-commit at gcc dot gnu dot org
2005-02-01 10:50 ` giovannibajo at libero dot it
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).