public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/40306] New: ICE when using auto to declare a local copy inside a member function
@ 2009-05-30 14:31 public at alisdairm dot net
2009-06-02 16:45 ` [Bug c++/40306] " jason at gcc dot gnu dot org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: public at alisdairm dot net @ 2009-05-30 14:31 UTC (permalink / raw)
To: gcc-bugs
Tested on MinGW 4.4.0
The following code produces an Internal Compiler Error:
template< typename T >
struct test {
test run() {
auto tmp = *this;
return tmp;
}
};
int main()
{
test<int> x;
x.run();
return 0;
}
Compiler output:
||=== AutoBug01, Debug ===|
In member function 'test<T> test<T>::run()':
error: in type_unification_real, at cp/pt.c:12477|
||=== Build finished: 1 errors, 0 warnings ===|
--
Summary: ICE when using auto to declare a local copy inside a
member function
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: public at alisdairm dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40306
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/40306] ICE when using auto to declare a local copy inside a member function
2009-05-30 14:31 [Bug c++/40306] New: ICE when using auto to declare a local copy inside a member function public at alisdairm dot net
@ 2009-06-02 16:45 ` jason at gcc dot gnu dot org
2009-06-02 17:03 ` jason at gcc dot gnu dot org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-06-02 16:45 UTC (permalink / raw)
To: gcc-bugs
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jason at gcc dot gnu dot org
|dot org |
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2009-06-02 16:45:24
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40306
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/40306] ICE when using auto to declare a local copy inside a member function
2009-05-30 14:31 [Bug c++/40306] New: ICE when using auto to declare a local copy inside a member function public at alisdairm dot net
2009-06-02 16:45 ` [Bug c++/40306] " jason at gcc dot gnu dot org
@ 2009-06-02 17:03 ` jason at gcc dot gnu dot org
2009-06-02 20:13 ` jason at gcc dot gnu dot org
2009-06-03 18:12 ` jason at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-06-02 17:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from jason at gcc dot gnu dot org 2009-06-02 17:03 -------
Subject: Bug 40306
Author: jason
Date: Tue Jun 2 17:02:27 2009
New Revision: 148088
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=148088
Log:
PR c++/40306
PR c++/40307
* decl.c (cp_finish_decl): Handle auto deduction from ().
* typeck.c (build_x_indirect_ref): Handle dereferencing an operand
with dependent type that is known to be a pointer.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/auto14.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl.c
trunk/gcc/cp/typeck.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40306
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/40306] ICE when using auto to declare a local copy inside a member function
2009-05-30 14:31 [Bug c++/40306] New: ICE when using auto to declare a local copy inside a member function public at alisdairm dot net
2009-06-02 16:45 ` [Bug c++/40306] " jason at gcc dot gnu dot org
2009-06-02 17:03 ` jason at gcc dot gnu dot org
@ 2009-06-02 20:13 ` jason at gcc dot gnu dot org
2009-06-03 18:12 ` jason at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-06-02 20:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from jason at gcc dot gnu dot org 2009-06-02 20:13 -------
Fixed for 4.4.1 and 4.5.
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.4.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40306
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/40306] ICE when using auto to declare a local copy inside a member function
2009-05-30 14:31 [Bug c++/40306] New: ICE when using auto to declare a local copy inside a member function public at alisdairm dot net
` (2 preceding siblings ...)
2009-06-02 20:13 ` jason at gcc dot gnu dot org
@ 2009-06-03 18:12 ` jason at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-06-03 18:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from jason at gcc dot gnu dot org 2009-06-03 18:12 -------
Subject: Bug 40306
Author: jason
Date: Wed Jun 3 18:11:53 2009
New Revision: 148141
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=148141
Log:
PR c++/40308
PR c++/40311
* typeck.c (cp_build_modify_expr): Always pass init-lists to the
conversion code.
* call.c (implicit_conversion): Allow init-list conversion to scalar
during direct-initialization, too. Mark the conversion bad if it
has too many levels of braces.
(convert_like_real): And give a helpful error.
PR c++/40306
PR c++/40307
* decl.c (cp_finish_decl): Handle auto deduction from ().
* typeck.c (build_x_indirect_ref): Handle dereferencing an operand
with dependent type that is known to be a pointer.
* call.c (implicit_conversion): Handle conversion from
initializer-list to scalar.
(convert_like_real): Likewise. Avoid crashing on list
initialization with bad conversions.
Added:
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/auto14.C
- copied unchanged from r148089,
trunk/gcc/testsuite/g++.dg/cpp0x/auto14.C
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/initlist16.C
- copied unchanged from r147933,
trunk/gcc/testsuite/g++.dg/cpp0x/initlist16.C
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/initlist17.C
- copied unchanged from r147933,
trunk/gcc/testsuite/g++.dg/cpp0x/initlist17.C
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/initlist18.C
- copied unchanged from r148089,
trunk/gcc/testsuite/g++.dg/cpp0x/initlist18.C
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/initlist19.C
- copied unchanged from r148089,
trunk/gcc/testsuite/g++.dg/cpp0x/initlist19.C
Modified:
branches/gcc-4_4-branch/gcc/cp/ChangeLog
branches/gcc-4_4-branch/gcc/cp/call.c
branches/gcc-4_4-branch/gcc/cp/decl.c
branches/gcc-4_4-branch/gcc/cp/typeck.c
branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/initlist13.C
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40306
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-06-03 18:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-30 14:31 [Bug c++/40306] New: ICE when using auto to declare a local copy inside a member function public at alisdairm dot net
2009-06-02 16:45 ` [Bug c++/40306] " jason at gcc dot gnu dot org
2009-06-02 17:03 ` jason at gcc dot gnu dot org
2009-06-02 20:13 ` jason at gcc dot gnu dot org
2009-06-03 18:12 ` jason 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).