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: unassig...@gcc.gnu.org

        ReportedBy: akim.demai...@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.

Reply via email to