Skip to content

Commit 4732be1

Browse files
authored
[Reflection] NFC: Enable building after clang r331013 (#16212)
1 parent af87582 commit 4732be1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

include/swift/Reflection/TypeRef.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,23 @@ enum class TypeRefKind {
4242
// Clang reports an error if we don't use "template"
4343
#if defined(__clang__) || defined(__GNUC__)
4444
#define DEPENDENT_TEMPLATE template
45+
#if __clang_major__ >= 7
46+
#define DEPENDENT_TEMPLATE2
47+
#else
48+
#define DEPENDENT_TEMPLATE2 template
49+
#endif
4550
#else
4651
#define DEPENDENT_TEMPLATE
4752
#endif
4853

4954
#define FIND_OR_CREATE_TYPEREF(Allocator, TypeRefTy, ...) \
5055
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()) \
5358
return Entry->second; \
5459
const auto TR = \
5560
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}); \
5762
return TR;
5863

5964
/// An identifier containing the unique bit pattern made up of all of the

0 commit comments

Comments
 (0)