public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "loximann at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug gcov-profile/95957] New: All lines except for the last one in multiline constructor reported as not run
Date: Mon, 29 Jun 2020 09:57:49 +0000	[thread overview]
Message-ID: <bug-95957-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95957

            Bug ID: 95957
           Summary: All lines except for the last one in multiline
                    constructor reported as not run
           Product: gcc
           Version: 10.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: gcov-profile
          Assignee: unassigned at gcc dot gnu.org
          Reporter: loximann at gmail dot com
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Source code:

#include <map>
#include <string>
#include <vector>

int main(int argc, char *argv[])
{
    static const std::vector<int> a{1,
        2,
        3,
        4};
    static const std::map<int, std::string> b{
        {1, "lol"}
    };
    b.at(1);
    return 0;
}

Command:
g++ --coverage coverage_test.cpp && ./a.out && gcov coverage_test.cpp

Gcov output:
        -:    0:Source:coverage_test.cpp
        -:    0:Graph:coverage_test.gcno
        -:    0:Data:coverage_test.gcda
        -:    0:Runs:1
        -:    1:#include <map>
        -:    2:#include <string>
        -:    3:#include <vector>
        -:    4:
        1:    5:int main(int argc, char *argv[])
        -:    6:{
        -:    7:    static const std::vector<int> a{1,
        -:    8:        2,
        -:    9:        3,
        2:   10:        4};
        -:   11:    static const std::map<int, std::string> b{
    #####:   12:        {1, "lol"}
        3:   13:    };
        1:   14:    b.at(1);
        1:   15:    return 0;
        -:   16:}

Line 12: should be marked as "-", same as 7, 8, 9 and 11 instead of "#####".

             reply	other threads:[~2020-06-29  9:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-29  9:57 loximann at gmail dot com [this message]
2020-06-29 11:10 ` [Bug gcov-profile/95957] " marxin at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-95957-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).