[PATCH] D30082: Fix assertion when generating debug information for deduced template specialization types.

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 16 22:59:37 PST 2017


EricWF marked an inline comment as done.
EricWF added inline comments.


================
Comment at: lib/CodeGen/CGDebugInfo.cpp:2479
+    case Type::DeducedTemplateSpecialization: {
+      QualType DT = dyn_cast<DeducedType>(T)->getDeducedType();
+      assert(!DT.isNull() && "Undeduced types shouldn't reach here.");
----------------
majnemer wrote:
> You are unconditionally dereferencing a dyn_cast, this seems bad. Is T sometimes not a DeducedType or should the dyn_cast be a cast?
Woops that should have been a `cast` instead of a `dyn_cast`. `T` should always be `DeducedType` (See AstContext.cpp:1879 for an example use of `cast<DeducedType>(...)` ).


https://reviews.llvm.org/D30082





More information about the cfe-commits mailing list