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++/64924] Callback function passed as a parameter with typename declaration produces an ICE.


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

Markus Trippelsdorf <trippels at gcc dot gnu.org> 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 <trippels at gcc dot gnu.org> ---
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<T>'
    PP(T* instance, typename PP::CallbackFunction callbackFunction);
                    ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
te.cpp:19:8: error: out-of-line definition of 'PP<T>' does not match any
declaration in 'PP<T>'
PP<T>::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<T>::PP" matches the
specified type
  PP<T>::PP(T* instance, CallbackFunction callbackFunction)
         ^

te.cpp(9): error: class "PP<JJ>" has no member "CallbackFunction"
      PP(T* instance, typename PP::CallbackFunction callbackFunction);
                                   ^
          detected during instantiation of class "PP<T> [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<T>::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 <http://gcc.gnu.org/bugs.html> for instructions.


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