-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate_template_typename.cpp
52 lines (42 loc) · 1.1 KB
/
template_template_typename.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// https://isocpp.org/files/papers/n4051.html
template<typename T> struct A {};
template<typename T> using B = int;
template<template<typename> class X> struct C;
C<A> ca; // ok
C<B> cb; // ok, not a class template
template<template<typename> typename X> struct D; // error, cannot use typename here
/*
static tree
cp_parser_type_parameter (cp_parser* parser, bool *is_parameter_pack)
Try this:
static bool
cp_parser_is_type_parameter_key(cp_parser* parser)
{
cp_token *token;
token = cp_lexer_peek_token (parser->lexer);
switch (token->keyword)
{
case RID_CLASS:
case RID_TYPENAME:
return true;
default:
gcc_unreachable ();
break;
}
return false;
}
This iexists...
static enum tag_types
cp_parser_token_is_class_key (cp_token* token)
{
In cp-tree.h
/* An enumeration of the kind of tags that C++ accepts. */
enum tag_types {
none_type = 0, /* Not a tag type. */
record_type, /* "struct" types. */
class_type, /* "class" types. */
union_type, /* "union" types. */
enum_type, /* "enum" types. */
typename_type /* "typename" types. */
};
*/