Fix Clang build

This commit is contained in:
complexlogic
2023-10-06 17:07:35 -07:00
committed by Urs Fleisch
parent 80837485cf
commit b4e79a4a27
3 changed files with 18 additions and 12 deletions

View File

@ -23,7 +23,7 @@
#include <memory>
#include "tag.h"
#include "matroskatag.h"
//#include "matroskatag.h"
namespace TagLib {
class String;

View File

@ -284,7 +284,10 @@ namespace
bool Matroska::Tag::setTag(const String &key, const String &value)
{
const auto& [name, targetTypeValue] = Matroska::Utils::translateKey(key);
const auto pair = Matroska::Utils::translateKey(key);
// Workaround Clang issue - no lambda capture of structured bindings
const String &name = pair.first;
auto targetTypeValue = pair.second;
if (name.isEmpty())
return false;
removeSimpleTags(
@ -305,7 +308,10 @@ bool Matroska::Tag::setTag(const String &key, const String &value)
const String* Matroska::Tag::getTag(const String &key) const
{
const auto& [name, targetTypeValue] = Matroska::Utils::translateKey(key);
const auto pair = Matroska::Utils::translateKey(key);
// Workaround Clang issue - no lambda capture of structured bindings
const String &name = pair.first;
auto targetTypeValue = pair.second;
if (name.isEmpty())
return nullptr;
auto tag = dynamic_cast<const Matroska::SimpleTagString*>(

View File

@ -29,10 +29,10 @@
#include "tstring.h"
#include "tlist.h"
#include "matroskafile.h"
#include "matroskasimpletag.h"
namespace TagLib {
namespace Matroska {
class SimpleTag;
using SimpleTagsList = List<SimpleTag*>;
class TAGLIB_EXPORT Tag : public TagLib::Tag
{
@ -50,14 +50,14 @@ namespace TagLib {
String genre() const override;
unsigned int year() const override;
unsigned int track() const override;
void setTitle(const String &s);
void setArtist(const String &s);
void setAlbum(const String &s);
void setComment(const String &s);
void setGenre(const String &s);
void setYear(unsigned int i);
void setTrack(unsigned int i);
bool isEmpty() const;
void setTitle(const String &s) override;
void setArtist(const String &s) override;
void setAlbum(const String &s) override;
void setComment(const String &s) override;
void setGenre(const String &s) override;
void setYear(unsigned int i) override;
void setTrack(unsigned int i) override;
bool isEmpty() const override;
PropertyMap properties() const override;
PropertyMap setProperties(const PropertyMap &propertyMap) override;
template <typename T>