]> granicus.if.org Git - clang/commit
DebugInfo: Ensure the ASTConsumer "HandleTagDeclRequireDefinition" callback path...
authorDavid Blaikie <dblaikie@gmail.com>
Wed, 16 Jul 2014 23:25:44 +0000 (23:25 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Wed, 16 Jul 2014 23:25:44 +0000 (23:25 +0000)
commitcf25fe23c6aec0c5bcc8b8bf84e3bd35a60b981c
tree509b08bab2f4c5a6a241820b6af80ae7fdee985f
parent0c982c2fac312c2462c43305801f01eaf5d6b5ba
DebugInfo: Ensure the ASTConsumer "HandleTagDeclRequireDefinition" callback path is tested.

By having the two variables 'a' and 'b' in this test in a namespace, the
type was required to be complete before any debug info was ever emitted
(the entire namespace is parsed before the variables were emitted), this
meant that the codepath in which a declaration is emitted, then later on
the type is required to be complete and the debug info must be upgraded
to a definition was not used.

Moving the variables outside a namespace fixes this test coverage bug.

(interestingly, code coverage didn't help here -
HandleTagDeclRequireDefinition is fully covered because it's called even
in cases where the type hasn't been emitted for debug info at all
(further down in CGDebugInfo this no-ops) - so CC wouldn't've helped
catch this test coverage problem)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213211 91177308-0d34-0410-b5e6-96231b3b80d8
test/CodeGenCXX/debug-info-class-limited.cpp