public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/16233] New: Bad diagnostic
@ 2004-06-27 17:25 igodard at pacbell dot net
2004-06-27 17:48 ` [Bug c++/16233] " pinskia at gcc dot gnu dot org
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: igodard at pacbell dot net @ 2004-06-27 17:25 UTC (permalink / raw)
To: gcc-bugs
template<typename T> struct A {
template<typename U> void Foo(){} };
template<typename V>struct B {
void Bar(V* v) {
v->template Foo<int>();
v->Foo<int>();
}
};
int main() {
A<bool> a;
B<A<bool> > b;
b.Bar(&a);
}
gets you:
~/ootbc/common/test/src$ g++ foo.cc
foo.cc: In member function `void B<V>::Bar(V*)':
foo.cc:6: error: expected primary-expression before "int"
foo.cc:6: error: expected `;' before "int"
The actual problem is the missing explicit "template" qualification. Surely the compiler can recognize "<int>" as a template argument list in this case. I grant that templates with data elements cannot be recognized in such a context:
--
Summary: Bad diagnostic
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: igodard at pacbell dot net
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16233
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/16233] Bad diagnostic
2004-06-27 17:25 [Bug c++/16233] New: Bad diagnostic igodard at pacbell dot net
@ 2004-06-27 17:48 ` pinskia at gcc dot gnu dot org
2004-06-27 17:53 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-27 17:48 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-27 17:41 -------
*** This bug has been marked as a duplicate of 16232 ***
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16233
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/16233] Bad diagnostic
2004-06-27 17:25 [Bug c++/16233] New: Bad diagnostic igodard at pacbell dot net
2004-06-27 17:48 ` [Bug c++/16233] " pinskia at gcc dot gnu dot org
@ 2004-06-27 17:53 ` pinskia at gcc dot gnu dot org
2004-06-27 17:55 ` [Bug c++/16233] unhelpful error message when "template" is omitted pinskia at gcc dot gnu dot org
2004-06-27 18:09 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-27 17:53 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-27 17:49 -------
Opps I was not looking to closly.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|DUPLICATE |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16233
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/16233] unhelpful error message when "template" is omitted
2004-06-27 17:25 [Bug c++/16233] New: Bad diagnostic igodard at pacbell dot net
2004-06-27 17:48 ` [Bug c++/16233] " pinskia at gcc dot gnu dot org
2004-06-27 17:53 ` pinskia at gcc dot gnu dot org
@ 2004-06-27 17:55 ` pinskia at gcc dot gnu dot org
2004-06-27 18:09 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-27 17:55 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-27 17:53 -------
Confirmed, here is shorter example:
template<typename V> void B(V a)
{
a.Foo<int> ();
}
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |diagnostic
Last reconfirmed|0000-00-00 00:00:00 |2004-06-27 17:53:41
date| |
Summary|Bad diagnostic |unhelpful error message when
| |"template" is omitted
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16233
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/16233] unhelpful error message when "template" is omitted
2004-06-27 17:25 [Bug c++/16233] New: Bad diagnostic igodard at pacbell dot net
` (2 preceding siblings ...)
2004-06-27 17:55 ` [Bug c++/16233] unhelpful error message when "template" is omitted pinskia at gcc dot gnu dot org
@ 2004-06-27 18:09 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-27 18:09 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-27 18:09 -------
*** Bug 16234 has been marked as a duplicate of this bug. ***
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16233
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/16233] unhelpful error message when "template" is omitted
[not found] <bug-16233-4@http.gcc.gnu.org/bugzilla/>
2012-04-12 11:51 ` redi at gcc dot gnu.org
2015-09-18 9:59 ` redi at gcc dot gnu.org
@ 2021-07-14 1:54 ` tobi at gcc dot gnu.org
2 siblings, 0 replies; 8+ messages in thread
From: tobi at gcc dot gnu.org @ 2021-07-14 1:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16233
Tobias Schlüter <tobi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2015-09-18 00:00:00 |2021-07-14 0:00
CC| |tobi at gcc dot gnu.org
--- Comment #11 from Tobias Schlüter <tobi at gcc dot gnu.org> ---
With the current trunk we still get the same message save for the carets
(https://godbolt.org/z/sWb7MbTWr)
<source>: In member function 'void B<V>::Bar(V*)':
<source>:6:16: error: expected primary-expression before 'int'
6 | v->Foo<int>();
| ^~~
<source>:6:16: error: expected ';' before 'int'
Compiler returned: 1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/16233] unhelpful error message when "template" is omitted
[not found] <bug-16233-4@http.gcc.gnu.org/bugzilla/>
2012-04-12 11:51 ` redi at gcc dot gnu.org
@ 2015-09-18 9:59 ` redi at gcc dot gnu.org
2021-07-14 1:54 ` tobi at gcc dot gnu.org
2 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2015-09-18 9:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16233
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2012-04-12 11:50:00 |2015-9-18
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #3)
> Confirmed, here is shorter example:
> template<typename V> void B(V a)
> {
> a.Foo<int> ();
> }
We still give the same error, just with a caret location now:
templ.cc: In function ‘void B(V)’:
templ.cc:3:9: error: expected primary-expression before ‘int’
a.Foo<int> ();
^
templ.cc:3:9: error: expected ‘;’ before ‘int’
whereas Clang is much better:
templ.cc:3:5: error: use 'template' keyword to treat 'Foo' as a dependent
template name
a.Foo<int> ();
^
template
1 error generated.
>From gcc-bugs-return-497499-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Sep 18 10:55:49 2015
Return-Path: <gcc-bugs-return-497499-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 118022 invoked by alias); 18 Sep 2015 10:55:49 -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 117974 invoked by uid 55); 18 Sep 2015 10:55:44 -0000
From: "alalaw01 at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/67283] GCC regression over inlining of returned structures
Date: Fri, 18 Sep 2015 10:55:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 5.2.0
X-Bugzilla-Keywords: missed-optimization
X-Bugzilla-Severity: normal
X-Bugzilla-Who: alalaw01 at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
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:
Message-ID: <bug-67283-4-9GL2u9WLxm@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67283-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67283-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: 2015-09/txt/msg01477.txt.bz2
Content-length: 986
https://gcc.gnu.org/bugzilla/show_bug.cgi?idg283
--- Comment #13 from alalaw01 at gcc dot gnu.org ---
Author: alalaw01
Date: Fri Sep 18 10:55:11 2015
New Revision: 227901
URL: https://gcc.gnu.org/viewcvs?rev"7901&root=gcc&view=rev
Log:
completely_scalarize arrays as well as records.
gcc/:
PR tree-optimization/67283
* tree-sra.c (type_consists_of_records_p): Rename to...
(scalarizable_type_p): ...this, add case for ARRAY_TYPE.
(completely_scalarize_record): Rename to...
(completely_scalarize): ...this, add ARRAY_TYPE case, move some code
to:
(scalarize_elem): New.
(analyze_all_variable_accesses): Follow renamings.
gcc/testsuite/:
* gcc.dg/tree-ssa/sra-15.c: New.
* gcc.dg/tree-ssa/sra-16.c: New.
Added:
trunk/gcc/testsuite/gcc.dg/tree-ssa/sra-15.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/sra-16.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-sra.c
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/16233] unhelpful error message when "template" is omitted
[not found] <bug-16233-4@http.gcc.gnu.org/bugzilla/>
@ 2012-04-12 11:51 ` redi at gcc dot gnu.org
2015-09-18 9:59 ` redi at gcc dot gnu.org
2021-07-14 1:54 ` tobi at gcc dot gnu.org
2 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2012-04-12 11:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16233
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2005-06-26 02:27:01 |2012-04-12 11:50
Known to fail| |4.7.0
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-04-12 11:50:39 UTC ---
reconfirming as still present in current releases
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2021-07-14 1:54 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-27 17:25 [Bug c++/16233] New: Bad diagnostic igodard at pacbell dot net
2004-06-27 17:48 ` [Bug c++/16233] " pinskia at gcc dot gnu dot org
2004-06-27 17:53 ` pinskia at gcc dot gnu dot org
2004-06-27 17:55 ` [Bug c++/16233] unhelpful error message when "template" is omitted pinskia at gcc dot gnu dot org
2004-06-27 18:09 ` pinskia at gcc dot gnu dot org
[not found] <bug-16233-4@http.gcc.gnu.org/bugzilla/>
2012-04-12 11:51 ` redi at gcc dot gnu.org
2015-09-18 9:59 ` redi at gcc dot gnu.org
2021-07-14 1:54 ` tobi 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).