* [Bug c++/54466] Recursive Type Alias, Member Function Pointer, Segmentation Fault
2012-09-03 11:07 [Bug c++/54466] New: Recursive Type Alias, Member Function Pointer, Segmentation Fault mattyclarkson at gmail dot com
@ 2012-10-16 15:47 ` mattyclarkson at gmail dot com
2012-10-16 15:56 ` [Bug c++/54466] [C++11] " redi at gcc dot gnu.org
` (15 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: mattyclarkson at gmail dot com @ 2012-10-16 15:47 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54466
--- Comment #1 from Matt Clarkson <mattyclarkson at gmail dot com> 2012-10-16 15:46:31 UTC ---
This is still an error on 4.7.2.
It is the const before the std::shared_ptr<const T> that is the problem:
template<typename T>
#if (__GNUC__ <= 4) && (__GNUC_MINOR__ <= 7) && (__GNUC_PATCHLEVEL__ <= 2)
using CallbackPtr = std::shared_ptr<const T>;
#else
// This causes a segmentation fault on G++ 4.7.2
// Bug Report: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54466
using CallbackPtr = const std::shared_ptr<const T>;
#endif
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/54466] [C++11] Recursive Type Alias, Member Function Pointer, Segmentation Fault
2012-09-03 11:07 [Bug c++/54466] New: Recursive Type Alias, Member Function Pointer, Segmentation Fault mattyclarkson at gmail dot com
2012-10-16 15:47 ` [Bug c++/54466] " mattyclarkson at gmail dot com
@ 2012-10-16 15:56 ` redi at gcc dot gnu.org
2012-10-16 22:32 ` paolo.carlini at oracle dot com
` (14 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2012-10-16 15:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54466
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-10-16
CC| |dodji at gcc dot gnu.org
Summary|Recursive Type Alias, |[C++11] Recursive Type
|Member Function Pointer, |Alias, Member Function
|Segmentation Fault |Pointer, Segmentation Fault
Ever Confirmed|0 |1
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-10-16 15:55:41 UTC ---
confirmed
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/54466] [C++11] Recursive Type Alias, Member Function Pointer, Segmentation Fault
2012-09-03 11:07 [Bug c++/54466] New: Recursive Type Alias, Member Function Pointer, Segmentation Fault mattyclarkson at gmail dot com
2012-10-16 15:47 ` [Bug c++/54466] " mattyclarkson at gmail dot com
2012-10-16 15:56 ` [Bug c++/54466] [C++11] " redi at gcc dot gnu.org
@ 2012-10-16 22:32 ` paolo.carlini at oracle dot com
2012-10-16 23:09 ` redi at gcc dot gnu.org
` (13 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-16 22:32 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54466
--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-16 22:32:02 UTC ---
A shorter self contained testcase, not involving the whole std::shared_ptr,
would certainly help. Dodji, are there any chances you can look into this
issue? The alias decls seem determinant.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/54466] [C++11] Recursive Type Alias, Member Function Pointer, Segmentation Fault
2012-09-03 11:07 [Bug c++/54466] New: Recursive Type Alias, Member Function Pointer, Segmentation Fault mattyclarkson at gmail dot com
` (2 preceding siblings ...)
2012-10-16 22:32 ` paolo.carlini at oracle dot com
@ 2012-10-16 23:09 ` redi at gcc dot gnu.org
2012-10-16 23:13 ` paolo.carlini at oracle dot com
` (12 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2012-10-16 23:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54466
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-10-16 23:09:30 UTC ---
template<typename T>
struct X { };
template<typename T>
using Y = const X<T>;
template<typename T>
using Z = Y<T>;
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/54466] [C++11] Recursive Type Alias, Member Function Pointer, Segmentation Fault
2012-09-03 11:07 [Bug c++/54466] New: Recursive Type Alias, Member Function Pointer, Segmentation Fault mattyclarkson at gmail dot com
` (3 preceding siblings ...)
2012-10-16 23:09 ` redi at gcc dot gnu.org
@ 2012-10-16 23:13 ` paolo.carlini at oracle dot com
2012-10-16 23:17 ` redi at gcc dot gnu.org
` (11 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-16 23:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54466
--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-16 23:13:18 UTC ---
Excellent.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/54466] [C++11] Recursive Type Alias, Member Function Pointer, Segmentation Fault
2012-09-03 11:07 [Bug c++/54466] New: Recursive Type Alias, Member Function Pointer, Segmentation Fault mattyclarkson at gmail dot com
` (4 preceding siblings ...)
2012-10-16 23:13 ` paolo.carlini at oracle dot com
@ 2012-10-16 23:17 ` redi at gcc dot gnu.org
2012-10-17 8:19 ` mattyclarkson at gmail dot com
` (10 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2012-10-16 23:17 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54466
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-10-16 23:16:48 UTC ---
The second alias doesn't even have to be a template to show the problem:
template<typename T>
struct X { };
template<typename T>
using Y = const X<T>;
using Z = Y<int>;
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/54466] [C++11] Recursive Type Alias, Member Function Pointer, Segmentation Fault
2012-09-03 11:07 [Bug c++/54466] New: Recursive Type Alias, Member Function Pointer, Segmentation Fault mattyclarkson at gmail dot com
` (5 preceding siblings ...)
2012-10-16 23:17 ` redi at gcc dot gnu.org
@ 2012-10-17 8:19 ` mattyclarkson at gmail dot com
2012-10-26 15:11 ` dodji at gcc dot gnu.org
` (9 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: mattyclarkson at gmail dot com @ 2012-10-17 8:19 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54466
--- Comment #7 from Matt Clarkson <mattyclarkson at gmail dot com> 2012-10-17 08:19:20 UTC ---
Sorry about the bloated bug report - that was how I came across it. In the
future I'll submit smaller test cases.
Thanks for looking into this.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/54466] [C++11] Recursive Type Alias, Member Function Pointer, Segmentation Fault
2012-09-03 11:07 [Bug c++/54466] New: Recursive Type Alias, Member Function Pointer, Segmentation Fault mattyclarkson at gmail dot com
` (6 preceding siblings ...)
2012-10-17 8:19 ` mattyclarkson at gmail dot com
@ 2012-10-26 15:11 ` dodji at gcc dot gnu.org
2012-10-26 15:13 ` dodji at seketeli dot org
` (8 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: dodji at gcc dot gnu.org @ 2012-10-26 15:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54466
Dodji Seketeli <dodji at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |dodji at gcc dot gnu.org
|gnu.org |
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/54466] [C++11] Recursive Type Alias, Member Function Pointer, Segmentation Fault
2012-09-03 11:07 [Bug c++/54466] New: Recursive Type Alias, Member Function Pointer, Segmentation Fault mattyclarkson at gmail dot com
` (7 preceding siblings ...)
2012-10-26 15:11 ` dodji at gcc dot gnu.org
@ 2012-10-26 15:13 ` dodji at seketeli dot org
2012-10-27 7:59 ` dodji at seketeli dot org
` (7 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: dodji at seketeli dot org @ 2012-10-26 15:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54466
--- Comment #8 from dodji at seketeli dot org <dodji at seketeli dot org> 2012-10-26 15:13:10 UTC ---
"paolo.carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org> a écrit:
> Dodji, are there any chances you can look into this
> issue? The alias decls seem determinant.
Sure. Sorry for the delay, I was buried into something else. I am
looking into this now.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/54466] [C++11] Recursive Type Alias, Member Function Pointer, Segmentation Fault
2012-09-03 11:07 [Bug c++/54466] New: Recursive Type Alias, Member Function Pointer, Segmentation Fault mattyclarkson at gmail dot com
` (8 preceding siblings ...)
2012-10-26 15:13 ` dodji at seketeli dot org
@ 2012-10-27 7:59 ` dodji at seketeli dot org
2012-11-13 16:08 ` dodji at gcc dot gnu.org
` (6 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: dodji at seketeli dot org @ 2012-10-27 7:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54466
--- Comment #9 from dodji at seketeli dot org <dodji at seketeli dot org> 2012-10-27 07:59:12 UTC ---
A candidate patch has been sent to
http://gcc.gnu.org/ml/gcc-patches/2012-10/msg02472.html.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/54466] [C++11] Recursive Type Alias, Member Function Pointer, Segmentation Fault
2012-09-03 11:07 [Bug c++/54466] New: Recursive Type Alias, Member Function Pointer, Segmentation Fault mattyclarkson at gmail dot com
` (9 preceding siblings ...)
2012-10-27 7:59 ` dodji at seketeli dot org
@ 2012-11-13 16:08 ` dodji at gcc dot gnu.org
2012-11-13 16:09 ` dodji at gcc dot gnu.org
` (5 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: dodji at gcc dot gnu.org @ 2012-11-13 16:08 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54466
--- Comment #10 from Dodji Seketeli <dodji at gcc dot gnu.org> 2012-11-13 16:07:50 UTC ---
Author: dodji
Date: Tue Nov 13 16:07:39 2012
New Revision: 193479
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193479
Log:
PR c++/54466 - ICE with alias template which type-id is const qualified
Consider this short example:
template<typename T>
struct X { };
template<typename T>
using Y = const X<T>;
using Z = Y<int>;
G++ crashes in lookup_class_template_1 while trying to build the alias
template instantiation Y<int>.
I think this is indirectly due to the fact that that
lookup_class_template_1 can now yield a const qualified type like
'const X<T>'.
As a consequence, the code in lookup_template_class_1 that was trying
to access the TYPE_STUB_DECL field of the result of
lookup_template_class_1 should now be adjusted to access the
TYPE_STUB_DECL of the main variant of the resulting type instead (and
that is TYPE_MAIN_DECL); because qualified types (constructed with
build_qualified_type) have their TYPE_STUB_DECL set to NULL.
Fixed thus and tested on x86_64-unknown-linux-gnu against trunk.
gcc/cp
PR c++/54466
* pt.c (lookup_template_class_1): TYPE_STUB_DECL should be
accessed on the main variant of the type.
gcc/testsuite/
* g++.dg/cpp0x/alias-decl-26.C: New test file.
In the example of this patch, g++ crashes when trying to build the
alias template Y<int
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/alias-decl-26.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/54466] [C++11] Recursive Type Alias, Member Function Pointer, Segmentation Fault
2012-09-03 11:07 [Bug c++/54466] New: Recursive Type Alias, Member Function Pointer, Segmentation Fault mattyclarkson at gmail dot com
` (10 preceding siblings ...)
2012-11-13 16:08 ` dodji at gcc dot gnu.org
@ 2012-11-13 16:09 ` dodji at gcc dot gnu.org
2012-11-14 14:24 ` mattyclarkson at gmail dot com
` (4 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: dodji at gcc dot gnu.org @ 2012-11-13 16:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54466
Dodji Seketeli <dodji at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #11 from Dodji Seketeli <dodji at gcc dot gnu.org> 2012-11-13 16:09:27 UTC ---
Fixed in trunk (4.8).
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/54466] [C++11] Recursive Type Alias, Member Function Pointer, Segmentation Fault
2012-09-03 11:07 [Bug c++/54466] New: Recursive Type Alias, Member Function Pointer, Segmentation Fault mattyclarkson at gmail dot com
` (11 preceding siblings ...)
2012-11-13 16:09 ` dodji at gcc dot gnu.org
@ 2012-11-14 14:24 ` mattyclarkson at gmail dot com
2012-11-14 14:29 ` redi at gcc dot gnu.org
` (3 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: mattyclarkson at gmail dot com @ 2012-11-14 14:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54466
--- Comment #12 from Matt Clarkson <mattyclarkson at gmail dot com> 2012-11-14 14:24:11 UTC ---
@Dodji, thanks for fixing this :) What release will this be in? 4.8.1?
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/54466] [C++11] Recursive Type Alias, Member Function Pointer, Segmentation Fault
2012-09-03 11:07 [Bug c++/54466] New: Recursive Type Alias, Member Function Pointer, Segmentation Fault mattyclarkson at gmail dot com
` (12 preceding siblings ...)
2012-11-14 14:24 ` mattyclarkson at gmail dot com
@ 2012-11-14 14:29 ` redi at gcc dot gnu.org
2012-11-15 13:52 ` dodji at seketeli dot org
` (2 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2012-11-14 14:29 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54466
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.8.0
--- Comment #13 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-11-14 14:29:19 UTC ---
4.8.0
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/54466] [C++11] Recursive Type Alias, Member Function Pointer, Segmentation Fault
2012-09-03 11:07 [Bug c++/54466] New: Recursive Type Alias, Member Function Pointer, Segmentation Fault mattyclarkson at gmail dot com
` (13 preceding siblings ...)
2012-11-14 14:29 ` redi at gcc dot gnu.org
@ 2012-11-15 13:52 ` dodji at seketeli dot org
2012-12-05 13:05 ` paolo.carlini at oracle dot com
2013-05-03 9:06 ` paolo.carlini at oracle dot com
16 siblings, 0 replies; 18+ messages in thread
From: dodji at seketeli dot org @ 2012-11-15 13:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54466
--- Comment #14 from dodji at seketeli dot org <dodji at seketeli dot org> 2012-11-15 13:52:18 UTC ---
"mattyclarkson at gmail dot com" <gcc-bugzilla@gcc.gnu.org> a écrit:
> @Dodji, thanks for fixing this :)
You are welcome. Sorry for the delay.
> What release will this be in? 4.8.1?
As Jon said, 4.8.0.
Cheers.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/54466] [C++11] Recursive Type Alias, Member Function Pointer, Segmentation Fault
2012-09-03 11:07 [Bug c++/54466] New: Recursive Type Alias, Member Function Pointer, Segmentation Fault mattyclarkson at gmail dot com
` (14 preceding siblings ...)
2012-11-15 13:52 ` dodji at seketeli dot org
@ 2012-12-05 13:05 ` paolo.carlini at oracle dot com
2013-05-03 9:06 ` paolo.carlini at oracle dot com
16 siblings, 0 replies; 18+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-12-05 13:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54466
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mattipee at yahoo dot co.uk
--- Comment #15 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-12-05 13:05:34 UTC ---
*** Bug 53026 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/54466] [C++11] Recursive Type Alias, Member Function Pointer, Segmentation Fault
2012-09-03 11:07 [Bug c++/54466] New: Recursive Type Alias, Member Function Pointer, Segmentation Fault mattyclarkson at gmail dot com
` (15 preceding siblings ...)
2012-12-05 13:05 ` paolo.carlini at oracle dot com
@ 2013-05-03 9:06 ` paolo.carlini at oracle dot com
16 siblings, 0 replies; 18+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-05-03 9:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54466
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ali.rostai at gmail dot com
--- Comment #16 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-05-03 09:06:07 UTC ---
*** Bug 57152 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 18+ messages in thread