Skip to content

Commit 70234ed

Browse files
Fix MSVC compile error in BitstreamRemarkParser.h when targeting C++17
The following errors are seen in our builds using MSVC 2022: BitstreamRemarkParser.h(115): error C2990: 'llvm::remarks::BitstreamBlockParserHelper': non-class template has already been declared as a class template BitstreamRemarkParser.h(66): note: see declaration of 'llvm::remarks::BitstreamBlockParserHelper' This change fixes the build issue by adding an explicit template argument to the `friend class` statements. This issue is not seen if using `-std:c++20`, but we still support building as C++17.
1 parent 67a284a commit 70234ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Remarks/BitstreamRemarkParser.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class BitstreamBlockParserHelper : public BitstreamBlockParserHelperBase {
112112
/// Helper to parse a META_BLOCK for a bitstream remark container.
113113
class BitstreamMetaParserHelper
114114
: public BitstreamBlockParserHelper<BitstreamMetaParserHelper> {
115-
friend class BitstreamBlockParserHelper;
115+
friend class BitstreamBlockParserHelper<BitstreamMetaParserHelper>;
116116

117117
public:
118118
struct ContainerInfo {
@@ -137,7 +137,7 @@ class BitstreamMetaParserHelper
137137
/// Helper to parse a REMARK_BLOCK for a bitstream remark container.
138138
class BitstreamRemarkParserHelper
139139
: public BitstreamBlockParserHelper<BitstreamRemarkParserHelper> {
140-
friend class BitstreamBlockParserHelper;
140+
friend class BitstreamBlockParserHelper<BitstreamRemarkParserHelper>;
141141

142142
protected:
143143
SmallVector<uint64_t, 5> Record;

0 commit comments

Comments
 (0)