Skip to content

Commit d9a7f15

Browse files
authored
Merge pull request #608 from j-cortial/cpp/fix/#432
Cpp/fix/#432
2 parents 6885f3f + cdb34fa commit d9a7f15

File tree

8 files changed

+395
-59
lines changed

8 files changed

+395
-59
lines changed

autogenerated/cpp.embedded.macro.tmLanguage.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

autogenerated/cpp.tmLanguage.json

Lines changed: 61 additions & 46 deletions
Large diffs are not rendered by default.

autogenerated/cpp_scopes.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ meta.tail.switch.cpp
245245
meta.tail.union.cpp
246246
meta.template.call.cpp
247247
meta.template.definition.cpp
248+
meta.template.explicit-instantiation.cpp
248249
meta.toc-list.banner.block.cpp
249250
meta.toc-list.banner.double-slash.cpp
250251
meta.using-namespace.cpp
@@ -402,6 +403,7 @@ storage.modifier.lambda.$0.cpp
402403
storage.modifier.pointer.cpp
403404
storage.modifier.reference.cpp
404405
storage.modifier.specifier.$3.cpp
406+
storage.modifier.specifier.extern.cpp
405407
storage.modifier.specifier.functional.post-parameters.$5.cpp
406408
storage.modifier.specifier.functional.pre-parameters.$0.cpp
407409
storage.modifier.specifier.parameter.cpp

language_examples/#079.spec.yaml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
- source: 'template '
1+
- source: template
2+
scopes:
3+
- meta.template.explicit-instantiation
4+
- storage.type.template
25
- source: class
36
scopesBegin:
47
- meta.block.class
@@ -36,9 +39,12 @@
3639
scopesEnd:
3740
- meta.block.class
3841
- source: template
42+
scopes:
43+
- meta.template.explicit-instantiation
44+
- storage.type.template
3945
- source: MyStack
4046
scopes:
41-
- entity.name.scope-resolution
47+
- entity.name.scope-resolution.function.call
4248
- source: <
4349
scopesBegin:
4450
- meta.template.call
@@ -64,7 +70,7 @@
6470
- source: '::'
6571
scopes:
6672
- punctuation.separator.namespace.access
67-
- punctuation.separator.scope-resolution
73+
- punctuation.separator.scope-resolution.function.call
6874
- source: MyStack
6975
scopes:
7076
- entity.name.function.call
@@ -82,9 +88,15 @@
8288
scopes:
8389
- punctuation.terminator.statement
8490
- source: extern
91+
scopesBegin:
92+
- meta.template.explicit-instantiation
8593
scopes:
8694
- storage.modifier.specifier.extern
87-
- source: ' template '
95+
- source: template
96+
scopes:
97+
- storage.type.template
98+
scopesEnd:
99+
- meta.template.explicit-instantiation
88100
- source: class
89101
scopesBegin:
90102
- meta.block.class
@@ -122,12 +134,18 @@
122134
scopesEnd:
123135
- meta.block.class
124136
- source: extern
137+
scopesBegin:
138+
- meta.template.explicit-instantiation
125139
scopes:
126140
- storage.modifier.specifier.extern
127-
- source: ' template'
141+
- source: template
142+
scopes:
143+
- storage.type.template
144+
scopesEnd:
145+
- meta.template.explicit-instantiation
128146
- source: MyStack
129147
scopes:
130-
- entity.name.scope-resolution
148+
- entity.name.scope-resolution.function.call
131149
- source: <
132150
scopesBegin:
133151
- meta.template.call
@@ -153,7 +171,7 @@
153171
- source: '::'
154172
scopes:
155173
- punctuation.separator.namespace.access
156-
- punctuation.separator.scope-resolution
174+
- punctuation.separator.scope-resolution.function.call
157175
- source: MyStack
158176
scopes:
159177
- entity.name.function.call

language_examples/#207.spec.yaml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@
4646
- punctuation.section.block.begin.bracket.curly.namespace
4747
scopesEnd:
4848
- meta.head.namespace
49-
- source: 'template '
49+
- source: template
5050
scopesBegin:
5151
- meta.body.namespace
52+
scopes:
53+
- meta.template.explicit-instantiation
54+
- storage.type.template
5255
- source: class
5356
scopesBegin:
5457
- meta.block.class
@@ -79,7 +82,10 @@
7982
- punctuation.terminator.statement
8083
scopesEnd:
8184
- meta.block.class
82-
- source: 'template '
85+
- source: template
86+
scopes:
87+
- meta.template.explicit-instantiation
88+
- storage.type.template
8389
- source: class
8490
scopesBegin:
8591
- meta.block.class
@@ -110,7 +116,10 @@
110116
- punctuation.terminator.statement
111117
scopesEnd:
112118
- meta.block.class
113-
- source: 'template '
119+
- source: template
120+
scopes:
121+
- meta.template.explicit-instantiation
122+
- storage.type.template
114123
- source: class
115124
scopesBegin:
116125
- meta.block.class
@@ -141,7 +150,10 @@
141150
- punctuation.terminator.statement
142151
scopesEnd:
143152
- meta.block.class
144-
- source: 'template '
153+
- source: template
154+
scopes:
155+
- meta.template.explicit-instantiation
156+
- storage.type.template
145157
- source: class
146158
scopesBegin:
147159
- meta.block.class
@@ -173,6 +185,9 @@
173185
scopesEnd:
174186
- meta.block.class
175187
- source: template
188+
scopes:
189+
- meta.template.explicit-instantiation
190+
- storage.type.template
176191
- source: '::'
177192
scopesBegin:
178193
- meta.function.definition.special.operator-overload
@@ -253,6 +268,9 @@
253268
scopes:
254269
- punctuation.terminator.statement
255270
- source: template
271+
scopes:
272+
- meta.template.explicit-instantiation
273+
- storage.type.template
256274
- source: '::'
257275
scopesBegin:
258276
- meta.function.definition.special.operator-overload
@@ -333,6 +351,9 @@
333351
scopes:
334352
- punctuation.terminator.statement
335353
- source: template
354+
scopes:
355+
- meta.template.explicit-instantiation
356+
- storage.type.template
336357
- source: '::'
337358
scopesBegin:
338359
- meta.function.definition.special.operator-overload
@@ -416,6 +437,9 @@
416437
scopes:
417438
- punctuation.terminator.statement
418439
- source: template
440+
scopes:
441+
- meta.template.explicit-instantiation
442+
- storage.type.template
419443
- source: '::'
420444
scopesBegin:
421445
- meta.function.definition.special.operator-overload

language_examples/#432.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
template <class T> struct Explicit {
2+
T t;
3+
};
4+
5+
template<> struct Explicit<void> {};
6+
7+
extern template struct Explicit<int>;
8+
9+
extern
10+
template
11+
struct Explicit<unsigned>;
12+
13+
template struct Explicit<int>;
14+
15+
template
16+
struct Explicit<unsigned>;

0 commit comments

Comments
 (0)