This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55962] New: improper location for static_assert
- From: "akim.demaille at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 13 Jan 2013 17:22:12 +0000
- Subject: [Bug c++/55962] New: improper location for static_assert
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55962
Bug #: 55962
Summary: improper location for static_assert
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: akim.demaille@gmail.com
In the following test case the location of the error points to the end of the
function, instead of the static_assert itself.
Cheers. (And happy new year!).
$ cat sa.cc
template <typename T>
int
foo(int b)
{
static_assert(T::value, "toto");
return b;
}
int
main()
{
foo<int>(12);
}
$ g++-mp-4.8 -Wall -std=c++11 sa.cc
sa.cc: In instantiation of 'int foo(int) [with T = int]':
sa.cc:12:14: required from here
sa.cc:6:11: error: 'value' is not a member of 'int'
return b;
^
$ g++-mp-4.8 --version
g++-mp-4.8 (MacPorts gcc48 4.8-20130106_0) 4.8.0 20130106 (experimental)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.