public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11582] New: Odd error message with dynamically sized template arg printing
@ 2003-07-18 22:25 bangerth at dealii dot org
2003-07-18 22:52 ` [Bug c++/11582] " gdr at integrable-solutions dot net
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: bangerth at dealii dot org @ 2003-07-18 22:25 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11582
Summary: Odd error message with dynamically sized template arg
printing
Product: gcc
Version: unknown
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bangerth at dealii dot org
CC: gcc-bugs at gcc dot gnu dot org,gdr at gcc dot gnu dot
org
Extracted from PR 6785:
I guess this is totally irrelevant (because the code is invalid), but nevertheless: for this code
-------------------------------------------------
template <typename T> int size();
template <int N> void f(int (&)[N]);
void g() {
int buf[size<int>()];
f( buf ) ;
}
-------------------------------------------------
we get the following error:
tmp/gg> ../build-gcc/gcc-install/bin/c++ -c x.cc
x.cc: In function `void g()':
x.cc:6: error: no matching function for call to `f(int[size() [with T = int]()])'
Note how we try to write the size of the array as an expression, which involves the
call to a templated function, and where it tries to place the template arg when
printing it. It is a little confusing to see the [with T=int] here, since T is nowhere referenced
before or after, and the placing is odd.
And then there is the duplicate () after the templates are printed. This can be seen here
too:
----------------------------------
int size();
template <int N> void f(int (&)[N]);
void g() {
int buf[size()];
f( buf ) ;
}
-------------------------------------
tmp/gg> ../build-gcc/gcc-install/bin/c++ -c x.cc
x.cc: In function `void g()':
x.cc:6: error: no matching function for call to `f(int[size()()])'
I think that looks just cute ;-)
W.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/11582] Odd error message with dynamically sized template arg printing
2003-07-18 22:25 [Bug c++/11582] New: Odd error message with dynamically sized template arg printing bangerth at dealii dot org
@ 2003-07-18 22:52 ` gdr at integrable-solutions dot net
2003-07-19 2:31 ` pinskia at physics dot uc dot edu
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: gdr at integrable-solutions dot net @ 2003-07-18 22:52 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11582
------- Additional Comments From gdr at integrable-solutions dot net 2003-07-18 22:52 -------
Subject: Re: New: Odd error message with dynamically sized template arg printing
"bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| -------------------------------------------------
| we get the following error:
| tmp/gg> ../build-gcc/gcc-install/bin/c++ -c x.cc
| x.cc: In function `void g()':
| x.cc:6: error: no matching function for call to `f(int[size() [with T = int]()])'
|
| Note how we try to write the size of the array as an expression, which involves the
| call to a templated function, and where it tries to place the template arg when
| printing it. It is a little confusing to see the [with T=int] here, since T is nowhere referenced
| before or after, and the placing is odd.
I agree with you, that looks ugly.
Fortunately, with the new pretty-printer being written, we should be
able to do better. But before that, I need to get rid of some odd
diagnostic functions, which is what I'm currently doing.
[...]
| x.cc:6: error: no matching function for call to `f(int[size()()])'
|
| I think that looks just cute ;-)
Again agreed.
We've been pulling out too important info, and trying hard to pull in
too irrelevant info.
-- Gaby
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/11582] Odd error message with dynamically sized template arg printing
2003-07-18 22:25 [Bug c++/11582] New: Odd error message with dynamically sized template arg printing bangerth at dealii dot org
2003-07-18 22:52 ` [Bug c++/11582] " gdr at integrable-solutions dot net
@ 2003-07-19 2:31 ` pinskia at physics dot uc dot edu
2003-07-19 3:00 ` bangerth at dealii dot org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-19 2:31 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11582
pinskia at physics dot uc dot edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2003-07-19 02:31:38
date| |
------- Additional Comments From pinskia at physics dot uc dot edu 2003-07-19 02:31 -------
I thought I saw the double pareneses problem in a different bug before but this error
message is confusing.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/11582] Odd error message with dynamically sized template arg printing
2003-07-18 22:25 [Bug c++/11582] New: Odd error message with dynamically sized template arg printing bangerth at dealii dot org
2003-07-18 22:52 ` [Bug c++/11582] " gdr at integrable-solutions dot net
2003-07-19 2:31 ` pinskia at physics dot uc dot edu
@ 2003-07-19 3:00 ` bangerth at dealii dot org
2003-08-17 12:43 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: bangerth at dealii dot org @ 2003-07-19 3:00 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11582
------- Additional Comments From bangerth at dealii dot org 2003-07-19 03:00 -------
Yeah, I thought of that other PR too when I opened this one. A brief search
finds PR 10345 for the double parentheses problem.
W.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/11582] Odd error message with dynamically sized template arg printing
2003-07-18 22:25 [Bug c++/11582] New: Odd error message with dynamically sized template arg printing bangerth at dealii dot org
` (2 preceding siblings ...)
2003-07-19 3:00 ` bangerth at dealii dot org
@ 2003-08-17 12:43 ` pinskia at gcc dot gnu dot org
2003-08-23 0:51 ` dhazeghi at yahoo dot com
2003-11-23 7:04 ` pinskia at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-17 12:43 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11582
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2003-07-19 02:31:38 |2003-08-17 12:43:09
date| |
Version|unknown |3.4
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-08-17 12:43 -------
It is even worse now:
First example:
pr11582.cc: In function `void g()':
pr11582.cc:7: error: no matching function for call to `f(int[((long unsigned
int)((<anonymous>)size() [with T = int]()))])'
Second example:
pr11582.1.cc: In function `void g()':
pr11582.1.cc:7: error: no matching function for call to `f(int[((long unsigned
int)((<anonymous>)size()()))])'
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/11582] Odd error message with dynamically sized template arg printing
2003-07-18 22:25 [Bug c++/11582] New: Odd error message with dynamically sized template arg printing bangerth at dealii dot org
` (3 preceding siblings ...)
2003-08-17 12:43 ` pinskia at gcc dot gnu dot org
@ 2003-08-23 0:51 ` dhazeghi at yahoo dot com
2003-11-23 7:04 ` pinskia at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-08-23 0:51 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11582
dhazeghi at yahoo dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|3.4 |---
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/11582] Odd error message with dynamically sized template arg printing
2003-07-18 22:25 [Bug c++/11582] New: Odd error message with dynamically sized template arg printing bangerth at dealii dot org
` (4 preceding siblings ...)
2003-08-23 0:51 ` dhazeghi at yahoo dot com
@ 2003-11-23 7:04 ` pinskia at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-23 7:04 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-11-23 07:04 -------
Looks like this has not been fixed but looks closer to what is needed:
pr11582.cc:7: error: no matching function for call to `f(int[((long unsigned int)((int)size
[with T = int]()))])'
--
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2003-08-17 12:43:09 |2003-11-23 07:04:15
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11582
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2003-11-23 7:04 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-18 22:25 [Bug c++/11582] New: Odd error message with dynamically sized template arg printing bangerth at dealii dot org
2003-07-18 22:52 ` [Bug c++/11582] " gdr at integrable-solutions dot net
2003-07-19 2:31 ` pinskia at physics dot uc dot edu
2003-07-19 3:00 ` bangerth at dealii dot org
2003-08-17 12:43 ` pinskia at gcc dot gnu dot org
2003-08-23 0:51 ` dhazeghi at yahoo dot com
2003-11-23 7:04 ` pinskia 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).