public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55962] New: improper location for static_assert
@ 2013-01-13 17:22 akim.demaille at gmail dot com
  2013-01-13 19:17 ` [Bug c++/55962] " manu at gcc dot gnu.org
  2021-08-02  0:24 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: akim.demaille at gmail dot com @ 2013-01-13 17:22 UTC (permalink / raw)
  To: gcc-bugs


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.


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

end of thread, other threads:[~2021-08-02  0:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-13 17:22 [Bug c++/55962] New: improper location for static_assert akim.demaille at gmail dot com
2013-01-13 19:17 ` [Bug c++/55962] " manu at gcc dot gnu.org
2021-08-02  0:24 ` pinskia at gcc dot gnu.org

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