This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/71710] New: ICE on valid C++11 code with decltype and alias template: in lookup_member, at cp/search.c:1255


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71710

            Bug ID: 71710
           Summary: ICE on valid C++11 code with decltype and alias
                    template: in lookup_member, at cp/search.c:1255
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

The following C++11 code causes an ICE when compiled with the current GCC trunk
on x86_64-linux-gnu in both 32-bit and 64-bit modes.  

This is a regression from 6.1.x.


$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 7.0.0 20160629 (experimental) [trunk revision 237855] (GCC) 
$ 
$ g++-6.1 -c -std=c++11 small.cpp
$ clang++-3.8 -c -std=c++11 small.cpp
$ 
$ g++-trunk -c -std=c++11 small.cpp
small.cpp: In substitution of âtemplate<class> template<int <anonymous> > using
T = decltype (((A*)(void)0)->A< <template-parameter-1-1> >::a) [with int
<anonymous> = C; <template-parameter-1-1> = <template-parameter-1-1>]â:
small.cpp:5:28:   required from here
small.cpp:4:42: internal compiler error: in lookup_member, at cp/search.c:1255
   template < int > using T = decltype (a);
                                          ^
0x8074d3 lookup_member(tree_node*, tree_node*, int, bool, int)
        ../../gcc-source-trunk/gcc/cp/search.c:1255
0x7dc098 finish_class_member_access_expr(cp_expr, tree_node*, bool, int)
        ../../gcc-source-trunk/gcc/cp/typeck.c:2824
0x6e52fd tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc-source-trunk/gcc/cp/pt.c:16946
0x6e9c4e tsubst(tree_node*, tree_node*, int, tree_node*)
        ../../gcc-source-trunk/gcc/cp/pt.c:13591
0x6f1a37 tsubst_decl
        ../../gcc-source-trunk/gcc/cp/pt.c:12369
0x6ea6ce tsubst(tree_node*, tree_node*, int, tree_node*)
        ../../gcc-source-trunk/gcc/cp/pt.c:12874
0x7028fd instantiate_template_1
        ../../gcc-source-trunk/gcc/cp/pt.c:17483
0x7028fd instantiate_template(tree_node*, tree_node*, int)
        ../../gcc-source-trunk/gcc/cp/pt.c:17534
0x6ea664 instantiate_alias_template
        ../../gcc-source-trunk/gcc/cp/pt.c:17564
0x6ea664 tsubst(tree_node*, tree_node*, int, tree_node*)
        ../../gcc-source-trunk/gcc/cp/pt.c:12901
0x6fe27f lookup_template_class_1
        ../../gcc-source-trunk/gcc/cp/pt.c:8422
0x6fe27f lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
        ../../gcc-source-trunk/gcc/cp/pt.c:8672
0x8176fd finish_template_type(tree_node*, tree_node*, int)
        ../../gcc-source-trunk/gcc/cp/semantics.c:3133
0x7a3c34 cp_parser_template_id
        ../../gcc-source-trunk/gcc/cp/parser.c:14919
0x7a3eda cp_parser_class_name
        ../../gcc-source-trunk/gcc/cp/parser.c:21223
0x79288d cp_parser_qualifying_entity
        ../../gcc-source-trunk/gcc/cp/parser.c:6250
0x79288d cp_parser_nested_name_specifier_opt
        ../../gcc-source-trunk/gcc/cp/parser.c:5934
0x7a4657 cp_parser_constructor_declarator_p
        ../../gcc-source-trunk/gcc/cp/parser.c:25135
0x7a4657 cp_parser_decl_specifier_seq
        ../../gcc-source-trunk/gcc/cp/parser.c:12748
0x7aeb35 cp_parser_single_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:25786
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ 


---------------------------------------------


template < typename > struct A
{
  A *a;
  template < int > using T = decltype (a);
  template < int C > T < C > foo ();
};

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]