Index: cfe/trunk/lib/CodeGen/CodeGenPGO.cpp =================================================================== --- cfe/trunk/lib/CodeGen/CodeGenPGO.cpp +++ cfe/trunk/lib/CodeGen/CodeGenPGO.cpp @@ -669,6 +669,9 @@ if (SkipCoverageMapping) return true; + if (!D->getBody()) + return true; + // Don't map the functions in system headers. const auto &SM = CGM.getContext().getSourceManager(); auto Loc = D->getBody()->getLocStart(); Index: cfe/trunk/test/CoverageMapping/empty-destructor.cpp =================================================================== --- cfe/trunk/test/CoverageMapping/empty-destructor.cpp +++ cfe/trunk/test/CoverageMapping/empty-destructor.cpp @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -triple i686-windows -emit-llvm-only -fcoverage-mapping -dump-coverage-mapping -fprofile-instrument=clang %s | FileCheck %s + +struct A { + virtual ~A(); +}; + +// CHECK: ?PR32761@@YAXXZ: +// CHECK-NEXT: File 0, [[@LINE+1]]:16 -> [[@LINE+3]]:2 = #0 +void PR32761() { + A a; +}