public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/64228] New: compile error not accurate expected ; before string constant
@ 2014-12-08 18:39 jg at jguk dot org
2021-08-27 19:12 ` [Bug c++/64228] " pinskia at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: jg at jguk dot org @ 2014-12-08 18:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64228
Bug ID: 64228
Summary: compile error not accurate expected ; before string
constant
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jg at jguk dot org
Using cygwin gcc (GCC) 4.8.3
Wondering if the missing << operator in the following line could be identified
$ g++ -O -Wall -Werror -o main main.cpp
main.cpp: In function ‘int main()’:
main.cpp:10:31: error: expected ‘;’ before string constant
std::cout << "oops " << i " number" << endl;
^
#include <iostream>
int main()
{
int i = 0;
std::cout << "oops " << i " number" << endl;
return 0;
}
Perhaps could say:
error: expected ‘;’ or ‘<<’ before string constant
Although, I realise there may be many things that could be fit in this space.
>From gcc-bugs-return-469793-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 08 18:39:58 2014
Return-Path: <gcc-bugs-return-469793-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 24756 invoked by alias); 8 Dec 2014 18:39:58 -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 24707 invoked by uid 48); 8 Dec 2014 18:39:55 -0000
From: "ville.voutilainen at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/63578] ICE with may_alias and auto
Date: Mon, 08 Dec 2014 18:39:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.8.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ville.voutilainen at gmail dot com
X-Bugzilla-Status: NEW
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: bug_status cf_reconfirmed_on cc version everconfirmed cf_known_to_fail
Message-ID: <bug-63578-4-yZgODJ8Nob@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63578-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63578-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: 2014-12/txt/msg00800.txt.bz2
Content-length: 620
https://gcc.gnu.org/bugzilla/show_bug.cgi?idc578
Ville Voutilainen <ville.voutilainen at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2014-12-08
CC| |ville.voutilainen at gmail dot com
Version|unknown |4.8.2
Ever confirmed|0 |1
Known to fail| |4.8.2, 4.9.1, 5.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/64228] compile error not accurate expected ; before string constant
2014-12-08 18:39 [Bug c++/64228] New: compile error not accurate expected ; before string constant jg at jguk dot org
@ 2021-08-27 19:12 ` pinskia at gcc dot gnu.org
2021-08-27 20:28 ` jg at jguk dot org
2021-08-27 20:33 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-27 19:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64228
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
Ever confirmed|0 |1
Last reconfirmed| |2021-08-27
Status|UNCONFIRMED |NEW
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The trunk show:
<source>: In function 'int main()':
<source>:7:30: error: expected ';' before string constant
7 | std::cout << "oops " << i " number" << endl;
| ^~~~~~~~~~
| ;
Error recovery is always hard even saying << might be wrong when you want +.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/64228] compile error not accurate expected ; before string constant
2014-12-08 18:39 [Bug c++/64228] New: compile error not accurate expected ; before string constant jg at jguk dot org
2021-08-27 19:12 ` [Bug c++/64228] " pinskia at gcc dot gnu.org
@ 2021-08-27 20:28 ` jg at jguk dot org
2021-08-27 20:33 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: jg at jguk dot org @ 2021-08-27 20:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64228
--- Comment #2 from Jonny Grant <jg at jguk dot org> ---
(In reply to Andrew Pinski from comment #1)
> The trunk show:
> <source>: In function 'int main()':
> <source>:7:30: error: expected ';' before string constant
> 7 | std::cout << "oops " << i " number" << endl;
> | ^~~~~~~~~~
> | ;
>
> Error recovery is always hard even saying << might be wrong when you want +.
Hi Andrew
You're right. The suggestion might not be what was desired. The caret location
is enough to help programmer fix the build error.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/64228] compile error not accurate expected ; before string constant
2014-12-08 18:39 [Bug c++/64228] New: compile error not accurate expected ; before string constant jg at jguk dot org
2021-08-27 19:12 ` [Bug c++/64228] " pinskia at gcc dot gnu.org
2021-08-27 20:28 ` jg at jguk dot org
@ 2021-08-27 20:33 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-27 20:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64228
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |WONTFIX
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
>The caret location is enough to help programmer fix the build error.
So I am going to close this as won't fix. I do think GCC can improve in other
areas dealing with error messages and there are many other open bugs dealing
those.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-08-27 20:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-08 18:39 [Bug c++/64228] New: compile error not accurate expected ; before string constant jg at jguk dot org
2021-08-27 19:12 ` [Bug c++/64228] " pinskia at gcc dot gnu.org
2021-08-27 20:28 ` jg at jguk dot org
2021-08-27 20:33 ` pinskia 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).