This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/57470] New: Wrong line number in diagnostic message
- From: "ai.azuma at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 30 May 2013 12:16:41 +0000
- Subject: [Bug c++/57470] New: Wrong line number in diagnostic message
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57470
Bug ID: 57470
Summary: Wrong line number in diagnostic message
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ai.azuma at gmail dot com
Created attachment 30225
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30225&action=edit
Output of -v option and preprocessed source with GCC 4.9.0 20130526
GCC 4.8.1 20130523 and 4.9.0 20130526 reject the following invalid code as
expected. However, the diagnostic message is not good.
//----------------------------------------
template<typename>
struct Incomplete;
template<typename T, T...>
struct S
{
static_assert(Incomplete<T>::value, "");
};
S<char> s;
//----------------------------------------
For the above code, 4.9.0 20130526 says;
main.cpp: In instantiation of 'struct S<char>':
main.cpp:10:9: required from here
main.cpp:6:1: error: incomplete type 'Incomplete<char>' used in nested name
specifier
{
^
GCC should point to line 7, not line 6. GCC 4.7.4 20130525 does not show a
caret but points to the wrong line number (line 6), too.