]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: check_dups_abstract_origin allow subprogram defined outside body.
authorMark Wielaard <mjw@redhat.com>
Fri, 8 Apr 2011 09:16:11 +0000 (11:16 +0200)
committerMark Wielaard <mjw@redhat.com>
Fri, 8 Apr 2011 09:16:11 +0000 (11:16 +0200)
A subprogram can be defined outside the body of the enclosing class,
then file and/or line attributes can differ.

dwarflint/check_dups_abstract_origin.cc

index 080d2f189f3cf5df53d8ed3821f77f7fb9326d94..9615cbdd7945bd856de4c451d263236daa07a829 100644 (file)
@@ -74,6 +74,15 @@ namespace
          && ! same)
        return true;
 
+      // A subprogram can be defined outside the body of the enclosing
+      // class, then file and/or line attributes can differ.
+      if (tag == DW_TAG_subprogram
+         && from == DW_AT_specification
+         && (at == DW_AT_decl_line || at == DW_AT_decl_file)
+         && ! same)
+       return true;
+
+
       return false;
     }