This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/67100] New: ICE(in type_dependent_expression_p) on macro function + user defined literal
- From: "tower120 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 03 Aug 2015 12:39:58 +0000
- Subject: [Bug c++/67100] New: ICE(in type_dependent_expression_p) on macro function + user defined literal
- Auto-submitted: auto-generated
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