-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
sample file:
#include "coders.h"
#include "format.h"
#include "magic_enum.hpp"
namespace coders
{
IntegerCodec getByName(const char* name)
{
return getByName(std::string_view(name));
}
IntegerCodec getByName(std::string_view name)
{
auto x = magic_enum::enum_cast<CoderType>(name);
if (x.has_value())
return getByType(x.value());
throw_runtime_error("unknown name:\"%*s\"", (int)name.size(), name.data());
}
std::vector<IntegerCodec> allCodecs()
{
const auto& values = magic_enum::enum_values<CoderType>();
std::vector<IntegerCodec> codecs;
codecs.reserve(values.size());
for (size_t i = 0; i < values.size(); ++i)
{
if (values[i] != CoderType::Null)
codecs.emplace_back(getByType(values[i]));
}
return codecs;
}
} // namespace coders
cccc
errors out:
Processing coders-allCodecs.cpp as C/C++ (c++.ansi)
coders-allCodecs.cpp(36): syntax error at token <EOF>
coders-allCodecs.cpp(6): trying to match namespace_block at 'namespace'
Also fails on 15+ year old c++ code. For example, override makes it fail:
template <uint32_t BlockSizeInUnitsOfPackSize = 8>
class FastPFor32 : public IntegerCODEC
{
public:
void encodeArray(const uint32_t* in, const size_t length, uint32_t* out, size_t& nvalue) override
{
pfor32.encodeArray(in, length, out, nvalue);
}
...
Processing coders.cpp as C/C++ (c++.ansi)
coders.cpp(124): syntax error at token void
coders.cpp(124): trying to match class_block_item_list at 'void'
seems alto to fail on things like std::vector, constexpr etc
Metadata
Metadata
Assignees
Labels
No labels