This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
DECL_SOURCE_LOCATION including return type and template type
- From: Martin Liška <mliska at suse dot cz>
- To: GCC Development <gcc at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>, Marek Polacek <polacek at redhat dot com>, David Malcolm <dmalcolm at redhat dot com>
- Date: Mon, 11 Mar 2019 13:12:50 +0100
- Subject: DECL_SOURCE_LOCATION including return type and template type
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