File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -42,18 +42,23 @@ enum class TypeRefKind {
42
42
// Clang reports an error if we don't use "template"
43
43
#if defined(__clang__) || defined(__GNUC__)
44
44
#define DEPENDENT_TEMPLATE template
45
+ #if __clang_major__ >= 7
46
+ #define DEPENDENT_TEMPLATE2
47
+ #else
48
+ #define DEPENDENT_TEMPLATE2 template
49
+ #endif
45
50
#else
46
51
#define DEPENDENT_TEMPLATE
47
52
#endif
48
53
49
54
#define FIND_OR_CREATE_TYPEREF (Allocator, TypeRefTy, ...) \
50
55
auto ID = Profile(__VA_ARGS__); \
51
- const auto Entry = Allocator.DEPENDENT_TEMPLATE TypeRefTy##s.find(ID); \
52
- if (Entry != Allocator.DEPENDENT_TEMPLATE TypeRefTy##s.end()) \
56
+ const auto Entry = Allocator.DEPENDENT_TEMPLATE2 TypeRefTy##s.find(ID); \
57
+ if (Entry != Allocator.DEPENDENT_TEMPLATE2 TypeRefTy##s.end()) \
53
58
return Entry->second; \
54
59
const auto TR = \
55
60
Allocator.DEPENDENT_TEMPLATE makeTypeRef<TypeRefTy>(__VA_ARGS__); \
56
- Allocator.DEPENDENT_TEMPLATE TypeRefTy##s.insert({ID, TR}); \
61
+ Allocator.DEPENDENT_TEMPLATE2 TypeRefTy##s.insert({ID, TR}); \
57
62
return TR;
58
63
59
64
// / An identifier containing the unique bit pattern made up of all of the
You can’t perform that action at this time.
0 commit comments