https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80780

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The default argument case is:

source_location f(source_location a = source_location::current()) {
  return a;
}

int main()
{
  auto loc = f(); // f's first argument corresponds to this line of code
  VERIFY( loc.line() == 8 ); // where line 8 is the line above
  VERIFY( loc.column() == 16 ); // assuming you use the closing paren of f()
  VERIFY( !__builtin_strcmp(loc.file_name(),__FILE__) );
  VERIFY( !__builtin_strcmp(loc.function_name(), __FUNCTION__) );
}

Reply via email to