public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* DECL_SOURCE_LOCATION including return type and template type
@ 2019-03-11 12:12 Martin Liška
  2019-05-07  7:07 ` Martin Liška
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Liška @ 2019-03-11 12:12 UTC (permalink / raw)
  To: GCC Development, Jason Merrill, Marek Polacek, David Malcolm

Hi.

For a test-case like:

───────┬─────────────────────────────────
       │ File: test.cpp
───────┼─────────────────────────────────
   1   │ template <class T>
   2   │ T
   3   │ abs(T x) {
   4   │     if (x < 0) {
   5   │         return -x;
   6   │     } else {
   7   │         return x;
   8   │     }
   9   │ }
  10   │ 
  11   │ int main(int argc, char **argv)
  12   │ {
  13   │   return abs<int> (argc);
  14   │ }

it would be handy in GCOV to provide extended source location
which would include return type and template type.
Right now, DECL_SOURCE_LOCATION is:
test.cpp:3:1-9:1

Would it be possible to achieve?
Thanks,
Martin

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: DECL_SOURCE_LOCATION including return type and template type
  2019-03-11 12:12 DECL_SOURCE_LOCATION including return type and template type Martin Liška
@ 2019-05-07  7:07 ` Martin Liška
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Liška @ 2019-05-07  7:07 UTC (permalink / raw)
  To: GCC Development, Jason Merrill, Marek Polacek, David Malcolm

PING^1

On 3/11/19 1:12 PM, Martin Liška wrote:
> Hi.
> 
> For a test-case like:
> 
> ───────┬─────────────────────────────────
>        │ File: test.cpp
> ───────┼─────────────────────────────────
>    1   │ template <class T>
>    2   │ T
>    3   │ abs(T x) {
>    4   │     if (x < 0) {
>    5   │         return -x;
>    6   │     } else {
>    7   │         return x;
>    8   │     }
>    9   │ }
>   10   │ 
>   11   │ int main(int argc, char **argv)
>   12   │ {
>   13   │   return abs<int> (argc);
>   14   │ }
> 
> it would be handy in GCOV to provide extended source location
> which would include return type and template type.
> Right now, DECL_SOURCE_LOCATION is:
> test.cpp:3:1-9:1
> 
> Would it be possible to achieve?
> Thanks,
> Martin
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-07  7:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-11 12:12 DECL_SOURCE_LOCATION including return type and template type Martin Liška
2019-05-07  7:07 ` Martin Liška

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).