public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/16093] New: Bad error messages for missing declarations.
@ 2004-06-20 10:56 carlo at gcc dot gnu dot org
2004-06-20 11:09 ` [Bug c++/16093] " carlo at gcc dot gnu dot org
2004-06-25 23:02 ` pinskia at gcc dot gnu dot org
0 siblings, 2 replies; 7+ messages in thread
From: carlo at gcc dot gnu dot org @ 2004-06-20 10:56 UTC (permalink / raw)
To: gcc-bugs
When a declaration is missing, the error returned by the compiler
is too confusing. Consider the following short test case;
namespace n {
int var;
//class foo { };
//template<typename T> class bar { };
}
n::var x1;
n::foo x3;
n::bar<int> x4;
The results in the following errors:
test.cc:7: error: `var' in namespace `n' does not name a type
test.cc:8: error: `foo' in namespace `n' does not name a type
test.cc:9: error: expected constructor, destructor, or type conversion before
'<' token
test.cc:9: error: expected `,' or `;' before '<' token
I'd like to suggest a different error for the case that there is
no declaration at all (this could be tested after it is already
detected that there is an error because foo is not a type):
test.cc:8: error: `foo' in namespace `n' is not declared
And of course, an improvement for templates. For example:
test.cc:9: error: `bar' in namespace `n' is not declared
--
Summary: Bad error messages for missing declarations.
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: carlo at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16093
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/16093] Bad error messages for missing declarations.
2004-06-20 10:56 [Bug c++/16093] New: Bad error messages for missing declarations carlo at gcc dot gnu dot org
@ 2004-06-20 11:09 ` carlo at gcc dot gnu dot org
2004-06-25 23:02 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 7+ messages in thread
From: carlo at gcc dot gnu dot org @ 2004-06-20 11:09 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From carlo at gcc dot gnu dot org 2004-06-20 11:09 -------
On second thought, make that:
test.cc:8: error: `n::foo' has not been declared
test.cc:9: error: `n::bar` has not been declared
This is the same format that one gets when doing
using n::foo;
Note that the full namespace should be used - and not
what is literally in the source. Consider:
namespace n1 {
namespace n2 {
}
}
namespace n3 {
namespace n2 {
class foo { };
}
}
using namespace n1;
n2::foo x;
Then one wants: error: `n1::n2::foo' has not been declared
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16093
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/16093] Bad error messages for missing declarations.
2004-06-20 10:56 [Bug c++/16093] New: Bad error messages for missing declarations carlo at gcc dot gnu dot org
2004-06-20 11:09 ` [Bug c++/16093] " carlo at gcc dot gnu dot org
@ 2004-06-25 23:02 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-25 23:02 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-25 22:58 -------
Confirmed, there might be another bug with the same problem.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |diagnostic
Last reconfirmed|0000-00-00 00:00:00 |2004-06-25 22:58:22
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16093
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/16093] Bad error messages for missing declarations.
[not found] <bug-16093-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2013-07-06 8:52 ` paolo.carlini at oracle dot com
@ 2013-07-06 9:13 ` manu at gcc dot gnu.org
3 siblings, 0 replies; 7+ messages in thread
From: manu at gcc dot gnu.org @ 2013-07-06 9:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16093
--- Comment #7 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Paolo Carlini from comment #6)
> Honestly I didn't pay attention to the second testcase and didn't consider
> the first issue serious enough ;) Anyway, let's keep this open for now,
> thanks.
The first issue is just a "nice-to-have" thing, but not very important. As for
the second issue, it is already opened in a more general way at PR52277.
>From gcc-bugs-return-425847-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Jul 06 09:25:41 2013
Return-Path: <gcc-bugs-return-425847-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 12457 invoked by alias); 6 Jul 2013 09:25:41 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 12402 invoked by uid 48); 6 Jul 2013 09:25:36 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/57835] variable tracking produces weird const
Date: Sat, 06 Jul 2013 09:25:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: debug
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jakub at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-57835-4-sFqCaR2tMp@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57835-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57835-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-07/txt/msg00354.txt.bz2
Content-length: 593
http://gcc.gnu.org/bugzilla/show_bug.cgi?idW835
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
And what exactly do you think is wrong about it?
The value of res looks to be really some_reg + (&from_ucs4 - 100), and
in RTL it is standard to place CONST around SYMBOL_REF plus CONST_INT, that
value doesn't change.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/16093] Bad error messages for missing declarations.
[not found] <bug-16093-4@http.gcc.gnu.org/bugzilla/>
2012-01-20 1:37 ` pinskia at gcc dot gnu.org
2013-07-06 6:09 ` manu at gcc dot gnu.org
@ 2013-07-06 8:52 ` paolo.carlini at oracle dot com
2013-07-06 9:13 ` manu at gcc dot gnu.org
3 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-07-06 8:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16093
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P2 |P3
--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Honestly I didn't pay attention to the second testcase and didn't consider the
first issue serious enough ;) Anyway, let's keep this open for now, thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/16093] Bad error messages for missing declarations.
[not found] <bug-16093-4@http.gcc.gnu.org/bugzilla/>
2012-01-20 1:37 ` pinskia at gcc dot gnu.org
@ 2013-07-06 6:09 ` manu at gcc dot gnu.org
2013-07-06 8:52 ` paolo.carlini at oracle dot com
2013-07-06 9:13 ` manu at gcc dot gnu.org
3 siblings, 0 replies; 7+ messages in thread
From: manu at gcc dot gnu.org @ 2013-07-06 6:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16093
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Paolo Carlini from comment #4)
> In my opinion we are currently doing pretty well: the columns are ok; we
> handle templates with no excess error messages and we specifically talk
> about 'template type' for those. Comparing also to current clang, I think
> this bug could be closed.
It has improved a lot yes. But I think the point of the original reporter is
that g++ should make a difference between the case where 'foo' has not been
declared in the current context or the case where 'var' has been declared but
it is not a type. This way G++ could do *better* than clang. ;-)
For the second testcase, we have also improved, since we print the full
namespace, but clang has the helpful:
test.cc:27:5: error: no type named 'foo' in namespace 'n1::n2'; did you mean
'n3::n2::foo'?
But this is now a minor enhancement, not really a bug.
>From gcc-bugs-return-425841-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Jul 06 06:47:21 2013
Return-Path: <gcc-bugs-return-425841-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 3187 invoked by alias); 6 Jul 2013 06:47:21 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 3146 invoked by uid 48); 6 Jul 2013 06:47:16 -0000
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/57834] [4.9 Regression] C_F_POINTER (only with -std=): accepts only explicit- and assumed-size arrays for FPTR when SHAPE is present
Date: Sat, 06 Jul 2013 06:47:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords: rejects-valid
X-Bugzilla-Severity: normal
X-Bugzilla-Who: burnus at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: keywords bug_status cf_reconfirmed_on cc target_milestone short_desc everconfirmed
Message-ID: <bug-57834-4-hCLlIUbJcq@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57834-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57834-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-07/txt/msg00348.txt.bz2
Content-length: 1013
http://gcc.gnu.org/bugzilla/show_bug.cgi?idW834
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-07-06
CC| |burnus at gcc dot gnu.org
Target Milestone|--- |4.9.0
Summary|C_F_POINTER |[4.9 Regression]
|regression(-std): accepts |C_F_POINTER (only with
|only explicit- and |-std=): accepts only
|assumed-size arrays for |explicit- and assumed-size
|FPTR when SHAPE is present |arrays for FPTR when SHAPE
| |is present
Ever confirmed|0 |1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/16093] Bad error messages for missing declarations.
[not found] <bug-16093-4@http.gcc.gnu.org/bugzilla/>
@ 2012-01-20 1:37 ` pinskia at gcc dot gnu.org
2013-07-06 6:09 ` manu at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-01-20 1:37 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16093
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-01-20 01:31:39 UTC ---
In all three cases on the trunk we get:
t.cc:7:1: error: ‘var’ in namespace ‘n’ does not name a type
t.cc:8:1: error: ‘foo’ in namespace ‘n’ does not name a type
t.cc:9:1: error: ‘bar’ in namespace ‘n’ does not name a type
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-07-06 9:13 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-20 10:56 [Bug c++/16093] New: Bad error messages for missing declarations carlo at gcc dot gnu dot org
2004-06-20 11:09 ` [Bug c++/16093] " carlo at gcc dot gnu dot org
2004-06-25 23:02 ` pinskia at gcc dot gnu dot org
[not found] <bug-16093-4@http.gcc.gnu.org/bugzilla/>
2012-01-20 1:37 ` pinskia at gcc dot gnu.org
2013-07-06 6:09 ` manu at gcc dot gnu.org
2013-07-06 8:52 ` paolo.carlini at oracle dot com
2013-07-06 9:13 ` manu at gcc dot gnu.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).