public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67100] New: ICE(in type_dependent_expression_p) on macro function + user defined literal
@ 2015-08-03 12:40 tower120 at gmail dot com
  2015-08-03 12:42 ` [Bug c++/67100] " tower120 at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: tower120 at gmail dot com @ 2015-08-03 12:40 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67100
           Summary: ICE(in type_dependent_expression_p) on macro function
                    + user defined literal
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tower120 at gmail dot com
  Target Milestone: ---

Live errors : #http://goo.gl/UlaJI7

The following code:
//-------------------------------------------------------------------------

#include <typeinfo>
#include <tuple>

#define CAT1(A, B) A ## B
#define CAT(A, B) CAT1(A, B)

#define TOKEN_TO_STRING(TOK) # TOK
#define STRINGIZE_TOKEN(TOK) TOKEN_TO_STRING(TOK)


template <char... chars>
using _tstring = std::integer_sequence<char, chars...>;

template <typename T, T... chars>
constexpr _tstring<chars...> operator""_tstr() { return { }; }

#define tstring(STR) decltype( CAT( TOKEN_TO_STRING(STR), _tstr) )



#define dispatch_forward_fn(fn_name, prefix) \
template<class Caller, class Me> \
struct Dispatcher<Caller, tstring(go_up), Me>{ \
    template<class ...Args, class ...ArgsRef> \
    inline decltype(auto) operator() (ArgsRef&&... args) {\
        return 0; \
    } \
};

#define dispatch_list_prefix \
template<class Caller, class Fn_name, class Me> \
struct Dispatcher; \
dispatch_forward_fn(go_up, _d)


dispatch_list_prefix

int main(){
    Dispatcher<void, tstring(go_up), void>()();
    return 0;
}


//-------------------------------------------------------------------------

Produces following error at gcc 4.9.2 (any flags):

/tmp/gcc-explorer-compiler11573-68-zk0erd/example.cpp: In instantiation of
'struct Dispatcher<void, std::integer_sequence<char, 'g', 'o', '_', 'u', 'p'>,
void>':
40 : required from here
37 : internal compiler error: in type_dependent_expression_p, at cp/pt.c:21020


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-08-19  9:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-03 12:40 [Bug c++/67100] New: ICE(in type_dependent_expression_p) on macro function + user defined literal tower120 at gmail dot com
2015-08-03 12:42 ` [Bug c++/67100] " tower120 at gmail dot com
2015-08-03 13:34 ` trippels at gcc dot gnu.org
2015-08-03 13:59 ` tower120 at gmail dot com
2015-08-19  9:37 ` mpolacek at gcc dot gnu.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).