From 88ccbd75431c4dc9e3e7bb48fba86a264d6ddfa1 Mon Sep 17 00:00:00 2001 From: Leonard Chan Date: Mon, 15 Oct 2018 19:59:52 +0000 Subject: [PATCH] added fix llvm-svn: 344548 --- .../modernize/UseDefaultMemberInitCheck.cpp | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp index 374fcb3..0e0bd36 100644 --- a/clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp @@ -60,6 +60,47 @@ static StringRef getValueOfValueInit(const QualType InitType) { case Type::STK_IntegralComplex: return getValueOfValueInit( InitType->getAs()->getElementType()); + case Type::STK_FixedPoint: + switch (InitType->getAs()->getKind()) { + case BuiltinType::ShortAccum: + case BuiltinType::SatShortAccum: + return "0.0hk"; + case BuiltinType::Accum: + case BuiltinType::SatAccum: + return "0.0k"; + case BuiltinType::LongAccum: + case BuiltinType::SatLongAccum: + return "0.0lk"; + case BuiltinType::UShortAccum: + case BuiltinType::SatUShortAccum: + return "0.0uhk"; + case BuiltinType::UAccum: + case BuiltinType::SatUAccum: + return "0.0uk"; + case BuiltinType::ULongAccum: + case BuiltinType::SatULongAccum: + return "0.0ulk"; + case BuiltinType::ShortFract: + case BuiltinType::SatShortFract: + return "0.0hr"; + case BuiltinType::Fract: + case BuiltinType::SatFract: + return "0.0r"; + case BuiltinType::LongFract: + case BuiltinType::SatLongFract: + return "0.0lr"; + case BuiltinType::UShortFract: + case BuiltinType::SatUShortFract: + return "0.0uhr"; + case BuiltinType::UFract: + case BuiltinType::SatUFract: + return "0.0ur"; + case BuiltinType::ULongFract: + case BuiltinType::SatULongFract: + return "0.0ulr"; + default: + llvm_unreachable("Unhandled fixed point BuiltinType"); + } } llvm_unreachable("Invalid scalar type kind"); } -- 2.7.4