public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/21768] New: [3.4/4.0/4.1 regression] ICE in error message due to violation of coding conventions
@ 2005-05-26 14:50 reichelt at gcc dot gnu dot org
2005-05-26 14:56 ` [Bug c++/21768] " reichelt at gcc dot gnu dot org
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-05-26 14:50 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3081 bytes --]
Compiling the following code snippet with the German locale enabled
causes an ICE:
================================
template<int,int> struct A;
template<int> struct A {};
================================
bug.cc:1: Fehler: previous declaration »template<int <anonymous>, int
<anonymous> > struct A«
bug.cc:2: Fehler: 2 Template-Parameter
bug.cc:2: interner Compiler-Fehler: in pp_base_format_text, bei
pretty-print.c:357
Bitte senden Sie einen vollständigen Fehlerbericht auf Englisch ein;
bearbeiten Sie die Quellen zunächst mit einem Präprozessor, wenn es
dienlich ist.
Fehler in der deutschen Übersetzung sind an de@li.org zu melden.
Gehen Sie gemäß den Hinweisen in <URL:http://gcc.gnu.org/bugs.html> vor.
This is partly due to the fact that the code snippet in cp/pt.c that
generates the original message violates the coding conventions
(see http://www.gnu.org/prep/standards/standards.html#Internationalization):
error ("used %d template parameter%s instead of %d",
TREE_VEC_LENGTH (tmpl_parms),
TREE_VEC_LENGTH (tmpl_parms) == 1 ? "" : "s",
TREE_VEC_LENGTH (parms));
The patch below fixes that by removing the conditional and using
"parameter(s)" in the text. This should simplify i18n efforts.
=============================================================================
--- gcc/gcc/cp/pt.c 2005-05-25 00:00:57.000000000 +0200
+++ gcc/gcc/cp/pt.c 2005-05-25 00:35:03.000000000 +0200
@@ -3225,10 +3225,9 @@ redeclare_class_template (tree type, tre
if (TREE_VEC_LENGTH (parms) != TREE_VEC_LENGTH (tmpl_parms))
{
cp_error_at ("previous declaration %qD", tmpl);
- error ("used %d template parameter%s instead of %d",
- TREE_VEC_LENGTH (tmpl_parms),
- TREE_VEC_LENGTH (tmpl_parms) == 1 ? "" : "s",
- TREE_VEC_LENGTH (parms));
+ error ("used %d template parameter(s) instead of %d",
+ TREE_VEC_LENGTH (tmpl_parms),
+ TREE_VEC_LENGTH (parms));
return;
}
=============================================================================
Alternatively, one could make two messages, one for 1 parameter
and one for 0 or more than 1. But I don't think that this is worthwhile.
Btw, do all languages use the plural form for 0 parameters?
That's an implicit assumption that might not be true.
The ICE with the German locale appeared in gcc 3.4.4 (before we did not
have a German translation for that error message).
Therefore I'd like to apply the patch not only to mainline, but also
to the 3.4 and 4.0 branch as a first step towards removing the ICE.
--
Summary: [3.4/4.0/4.1 regression] ICE in error message due to
violation of coding conventions
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-code
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=21768
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/21768] [3.4/4.0/4.1 regression] ICE in error message due to violation of coding conventions
2005-05-26 14:50 [Bug c++/21768] New: [3.4/4.0/4.1 regression] ICE in error message due to violation of coding conventions reichelt at gcc dot gnu dot org
@ 2005-05-26 14:56 ` reichelt at gcc dot gnu dot org
2005-05-26 15:47 ` pinskia at gcc dot gnu dot org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-05-26 14:56 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
URL| |http://gcc.gnu.org/ml/gcc-
| |patches/2005-
| |05/msg02494.html
Keywords| |patch
Target Milestone|--- |3.4.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21768
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/21768] [3.4/4.0/4.1 regression] ICE in error message due to violation of coding conventions
2005-05-26 14:50 [Bug c++/21768] New: [3.4/4.0/4.1 regression] ICE in error message due to violation of coding conventions reichelt at gcc dot gnu dot org
2005-05-26 14:56 ` [Bug c++/21768] " reichelt at gcc dot gnu dot org
@ 2005-05-26 15:47 ` pinskia at gcc dot gnu dot org
2005-05-26 16:10 ` cvs-commit at gcc dot gnu dot org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-26 15:47 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-26 14:56 -------
Confirmed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-05-26 14:56:47
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21768
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/21768] [3.4/4.0/4.1 regression] ICE in error message due to violation of coding conventions
2005-05-26 14:50 [Bug c++/21768] New: [3.4/4.0/4.1 regression] ICE in error message due to violation of coding conventions reichelt at gcc dot gnu dot org
2005-05-26 14:56 ` [Bug c++/21768] " reichelt at gcc dot gnu dot org
2005-05-26 15:47 ` pinskia at gcc dot gnu dot org
@ 2005-05-26 16:10 ` cvs-commit at gcc dot gnu dot org
2005-05-26 16:14 ` cvs-commit at gcc dot gnu dot org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-05-26 16:10 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-05-26 16:05 -------
Subject: Bug 21768
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: reichelt@gcc.gnu.org 2005-05-26 16:04:45
Modified files:
gcc/cp : ChangeLog pt.c
Log message:
PR c++/21768
* pt.c (redeclare_class_template): Change error message according
to coding conventions.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4757&r2=1.4758
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.998&r2=1.999
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21768
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/21768] [3.4/4.0/4.1 regression] ICE in error message due to violation of coding conventions
2005-05-26 14:50 [Bug c++/21768] New: [3.4/4.0/4.1 regression] ICE in error message due to violation of coding conventions reichelt at gcc dot gnu dot org
` (2 preceding siblings ...)
2005-05-26 16:10 ` cvs-commit at gcc dot gnu dot org
@ 2005-05-26 16:14 ` cvs-commit at gcc dot gnu dot org
2005-05-26 16:17 ` cvs-commit at gcc dot gnu dot org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-05-26 16:14 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-05-26 16:09 -------
Subject: Bug 21768
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-4_0-branch
Changes by: reichelt@gcc.gnu.org 2005-05-26 16:09:04
Modified files:
gcc/cp : ChangeLog pt.c
Log message:
PR c++/21768
* pt.c (redeclare_class_template): Change error message according
to coding conventions.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.4648.2.44&r2=1.4648.2.45
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.978.2.10&r2=1.978.2.11
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21768
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/21768] [3.4/4.0/4.1 regression] ICE in error message due to violation of coding conventions
2005-05-26 14:50 [Bug c++/21768] New: [3.4/4.0/4.1 regression] ICE in error message due to violation of coding conventions reichelt at gcc dot gnu dot org
` (3 preceding siblings ...)
2005-05-26 16:14 ` cvs-commit at gcc dot gnu dot org
@ 2005-05-26 16:17 ` cvs-commit at gcc dot gnu dot org
2005-05-26 16:41 ` reichelt at gcc dot gnu dot org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-05-26 16:17 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-05-26 16:13 -------
Subject: Bug 21768
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-3_4-branch
Changes by: reichelt@gcc.gnu.org 2005-05-26 16:13:41
Modified files:
gcc/cp : ChangeLog pt.c
Log message:
PR c++/21768
* pt.c (redeclare_class_template): Change error message according
to coding conventions.
Patches:
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.219&r2=1.3892.2.220
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.52&r2=1.816.2.53
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21768
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/21768] [3.4/4.0/4.1 regression] ICE in error message due to violation of coding conventions
2005-05-26 14:50 [Bug c++/21768] New: [3.4/4.0/4.1 regression] ICE in error message due to violation of coding conventions reichelt at gcc dot gnu dot org
` (4 preceding siblings ...)
2005-05-26 16:17 ` cvs-commit at gcc dot gnu dot org
@ 2005-05-26 16:41 ` reichelt at gcc dot gnu dot org
2005-05-26 16:56 ` reichelt at gcc dot gnu dot org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-05-26 16:41 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2005-05-26 16:17 -------
OK, the original error messages have been fixed for gcc 3.4.5,
gcc 4.0.1 and mainline.
Let's keep the PR open until the .po files got fixed, too.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21768
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/21768] [3.4/4.0/4.1 regression] ICE in error message due to violation of coding conventions
2005-05-26 14:50 [Bug c++/21768] New: [3.4/4.0/4.1 regression] ICE in error message due to violation of coding conventions reichelt at gcc dot gnu dot org
` (5 preceding siblings ...)
2005-05-26 16:41 ` reichelt at gcc dot gnu dot org
@ 2005-05-26 16:56 ` reichelt at gcc dot gnu dot org
2005-06-29 14:02 ` [Bug c++/21768] [3.4 " reichelt at gcc dot gnu dot org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-05-26 16:56 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2005-05-26 16:54 -------
For the record:
I just notified the translation team.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21768
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/21768] [3.4 regression] ICE in error message due to violation of coding conventions
2005-05-26 14:50 [Bug c++/21768] New: [3.4/4.0/4.1 regression] ICE in error message due to violation of coding conventions reichelt at gcc dot gnu dot org
` (6 preceding siblings ...)
2005-05-26 16:56 ` reichelt at gcc dot gnu dot org
@ 2005-06-29 14:02 ` reichelt at gcc dot gnu dot org
2005-07-04 9:53 ` [Bug translation/21768] " reichelt at gcc dot gnu dot org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-06-29 14:02 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2005-06-29 14:02 -------
The .po files have been fixed for GCC 4.0.1 and mainline.
We are just missing the .po file for GCC 3.4.5.
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|[3.4/4.0/4.1 regression] ICE|[3.4 regression] ICE in
|in error message due to |error message due to
|violation of coding |violation of coding
|conventions |conventions
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21768
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug translation/21768] [3.4 regression] ICE in error message due to violation of coding conventions
2005-05-26 14:50 [Bug c++/21768] New: [3.4/4.0/4.1 regression] ICE in error message due to violation of coding conventions reichelt at gcc dot gnu dot org
` (7 preceding siblings ...)
2005-06-29 14:02 ` [Bug c++/21768] [3.4 " reichelt at gcc dot gnu dot org
@ 2005-07-04 9:53 ` reichelt at gcc dot gnu dot org
2005-08-31 13:47 ` bonzini at gcc dot gnu dot org
2005-08-31 15:43 ` reichelt at igpm dot rwth-aachen dot de
10 siblings, 0 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-07-04 9:53 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2005-07-04 09:53 -------
Changing component, since we are only missing the updated .po file.
--
What |Removed |Added
----------------------------------------------------------------------------
Component|c++ |translation
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21768
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug translation/21768] [3.4 regression] ICE in error message due to violation of coding conventions
2005-05-26 14:50 [Bug c++/21768] New: [3.4/4.0/4.1 regression] ICE in error message due to violation of coding conventions reichelt at gcc dot gnu dot org
` (8 preceding siblings ...)
2005-07-04 9:53 ` [Bug translation/21768] " reichelt at gcc dot gnu dot org
@ 2005-08-31 13:47 ` bonzini at gcc dot gnu dot org
2005-08-31 15:43 ` reichelt at igpm dot rwth-aachen dot de
10 siblings, 0 replies; 12+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2005-08-31 13:47 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bonzini at gcc dot gnu dot org 2005-08-31 13:36 -------
This ought to use ngettext.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21768
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug translation/21768] [3.4 regression] ICE in error message due to violation of coding conventions
2005-05-26 14:50 [Bug c++/21768] New: [3.4/4.0/4.1 regression] ICE in error message due to violation of coding conventions reichelt at gcc dot gnu dot org
` (9 preceding siblings ...)
2005-08-31 13:47 ` bonzini at gcc dot gnu dot org
@ 2005-08-31 15:43 ` reichelt at igpm dot rwth-aachen dot de
10 siblings, 0 replies; 12+ messages in thread
From: reichelt at igpm dot rwth-aachen dot de @ 2005-08-31 15:43 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at igpm dot rwth-aachen dot de 2005-08-31 15:39 -------
Subject: Re: [3.4 regression] ICE in error message due
to violation of coding conventions
On 31 Aug, bonzini at gcc dot gnu dot org wrote:
> This ought to use ngettext.
That's not necessary.
The trickery with the plural s that would have made ngettext necessary
was a violation of the coding conventions, anyway. This is already fixed
by using a different error message.
We are just waiting for a new .po file with a suitable translation.
This won't arrive until close to the release, however.
This PR is just a reminder to test whether the translation really got
fixed before spinning the release.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21768
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2005-08-31 15:40 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-26 14:50 [Bug c++/21768] New: [3.4/4.0/4.1 regression] ICE in error message due to violation of coding conventions reichelt at gcc dot gnu dot org
2005-05-26 14:56 ` [Bug c++/21768] " reichelt at gcc dot gnu dot org
2005-05-26 15:47 ` pinskia at gcc dot gnu dot org
2005-05-26 16:10 ` cvs-commit at gcc dot gnu dot org
2005-05-26 16:14 ` cvs-commit at gcc dot gnu dot org
2005-05-26 16:17 ` cvs-commit at gcc dot gnu dot org
2005-05-26 16:41 ` reichelt at gcc dot gnu dot org
2005-05-26 16:56 ` reichelt at gcc dot gnu dot org
2005-06-29 14:02 ` [Bug c++/21768] [3.4 " reichelt at gcc dot gnu dot org
2005-07-04 9:53 ` [Bug translation/21768] " reichelt at gcc dot gnu dot org
2005-08-31 13:47 ` bonzini at gcc dot gnu dot org
2005-08-31 15:43 ` reichelt at igpm dot rwth-aachen dot de
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).