From 8b66ca3e6b6a6729894f638944ceda8c79ca078c Mon Sep 17 00:00:00 2001 From: Martchus Date: Sun, 19 Sep 2021 01:17:30 +0200 Subject: [PATCH] Avoid using `DeclBase::getLangOpts()` to support older Clang versions The `DeclBase::getLangOpts()` is merely a convenience but only available in Clang 11 or newer. --- generator/serializationcodegenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/serializationcodegenerator.cpp b/generator/serializationcodegenerator.cpp index 6c6a936..ae3a774 100644 --- a/generator/serializationcodegenerator.cpp +++ b/generator/serializationcodegenerator.cpp @@ -96,7 +96,7 @@ void SerializationCodeGenerator::computeRelevantClass(RelevantClass &possiblyRel // consider all classes inheriting from an instantiation of "JsonSerializable" relevant if (const auto *const relevantBase = inheritsFromInstantiationOf(possiblyRelevantClass.record, m_qualifiedNameOfRecords)) { - auto policy = clang::PrintingPolicy(possiblyRelevantClass.record->getLangOpts()); + auto policy = clang::PrintingPolicy(possiblyRelevantClass.record->getASTContext().getLangOpts()); policy.FullyQualifiedName = true; policy.SuppressScope = false; policy.SuppressUnwrittenScope = false;