From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10134 invoked by alias); 3 Feb 2015 18:17:49 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 10100 invoked by uid 48); 3 Feb 2015 18:17:44 -0000 From: "trippels at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/64924] Callback function passed as a parameter with typename declaration produces an ICE. Date: Tue, 03 Feb 2015 18:17: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: minor X-Bugzilla-Who: trippels at gcc dot gnu.org 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 everconfirmed cf_known_to_fail Message-ID: In-Reply-To: References: 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-02/txt/msg00243.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64924 Markus Trippelsdorf changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2015-02-03 CC| |trippels at gcc dot gnu.org Ever confirmed|0 |1 Known to fail| |4.8.4, 4.9.2, 5.0 --- Comment #1 from Markus Trippelsdorf --- clang and the intel compiler reject the testcase. All supported gcc versions crash. markus@x4 /tmp % clang++ -std=c++11 te.cpp te.cpp:9:34: error: no type named 'CallbackFunction' in 'PP' PP(T* instance, typename PP::CallbackFunction callbackFunction); ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ te.cpp:19:8: error: out-of-line definition of 'PP' does not match any declaration in 'PP' PP::PP(T* instance, CallbackFunction callbackFunction) ^~ 2 errors generated. markus@x4 /tmp % icpc -std=c++11 te.cpp te.cpp(19): error: no instance of overloaded function "PP::PP" matches the specified type PP::PP(T* instance, CallbackFunction callbackFunction) ^ te.cpp(9): error: class "PP" has no member "CallbackFunction" PP(T* instance, typename PP::CallbackFunction callbackFunction); ^ detected during instantiation of class "PP [with T=JJ]" at line 42 compilation aborted for te.cpp (code 2) markus@x4 /tmp % g++ -std=c++11 te.cpp te.cpp:19:57: internal compiler error: Segmentation fault PP::PP(T* instance, CallbackFunction callbackFunction) ^ 0xc96d4f crash_signal ../../gcc/gcc/toplev.c:383 0xeeed10 strip_array_types(tree_node*) ../../gcc/gcc/tree.c:8025 0x73c1e8 cp_type_quals(tree_node const*) ../../gcc/gcc/cp/typeck.c:8916 0x73c2b8 original_type ../../gcc/gcc/cp/typeck.c:259 0x7431d8 merge_types(tree_node*, tree_node*) ../../gcc/gcc/cp/typeck.c:752 0x743313 merge_types(tree_node*, tree_node*) ../../gcc/gcc/cp/typeck.c:797 0x7438fb commonparms ../../gcc/gcc/cp/typeck.c:243 0x7438fb merge_types(tree_node*, tree_node*) ../../gcc/gcc/cp/typeck.c:863 0x743ac3 merge_types(tree_node*, tree_node*) ../../gcc/gcc/cp/typeck.c:898 0x62c083 duplicate_decls(tree_node*, tree_node*, bool) ../../gcc/gcc/cp/decl.c:1975 0x590a5c grokfndecl ../../gcc/gcc/cp/decl.c:8035 0x639dbd grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*, decl_context, int, tree_node**) ../../gcc/gcc/cp/decl.c:10992 0x63b466 start_function(cp_decl_specifier_seq*, cp_declarator const*, tree_node*) ../../gcc/gcc/cp/decl.c:13730 0x72798c cp_parser_function_definition_from_specifiers_and_declarator ../../gcc/gcc/cp/parser.c:23342 0x72798c cp_parser_init_declarator ../../gcc/gcc/cp/parser.c:17064 0x72832c cp_parser_single_declaration ../../gcc/gcc/cp/parser.c:23801 0x7285b2 cp_parser_template_declaration_after_export ../../gcc/gcc/cp/parser.c:23592 0x731ab9 cp_parser_declaration ../../gcc/gcc/cp/parser.c:11336 0x731baa cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:11258 0x731ebf cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:4109 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions.