This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/41373] attribute error and warning dont show the instantiation stack
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 07 Feb 2017 20:24:15 +0000
- Subject: [Bug c++/41373] attribute error and warning dont show the instantiation stack
- Auto-submitted: auto-generated
- References: <bug-41373-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41373
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-02-07
CC| |msebor at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed with recent trunk of GCC 7. The instantiation context should be
present in all diagnostics.
$ cat t.C && gcc -S -Wall t.C
void f (int) __attribute__ ((error ("error")));
void f (double) __attribute__ ((warning ("warning")));
void f (void*) __attribute__ ((deprecated));
template <class T>
void g ()
{
f (T ());
}
int main ()
{
g<int>();
g<double>();
g<void*>();
}
t.C: In instantiation of ‘void g() [with T = void*]’:
t.C:15:12: required from here
t.C:8:5: warning: ‘void f(void*)’ is deprecated [-Wdeprecated-declarations]
f (T ());
~~^~~~~~
t.C:3:6: note: declared here
void f (void*) __attribute__ ((deprecated));
^
t.C: In function ‘void g() [with T = int]’:
t.C:8:5: error: call to ‘f’ declared with attribute error: error
f (T ());
~~^~~~~~
t.C: In function ‘void g() [with T = double]’:
t.C:8:5: warning: call to ‘f’ declared with attribute warning: warning
f (T ());
~~^~~~~~