https://bugs.llvm.org/show_bug.cgi?id=32347

            Bug ID: 32347
           Summary: Clang is reporting wrong "previous declaration is
                    here" notes
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: heavenandhell...@gmail.com
                CC: llvm-bugs@lists.llvm.org

Clang version 5.0.0 (trunk 298027)

This snippet is from the Microsoft STL contained in one of the recent MSVC
nightly builds.

$ cat Test.cpp
template<class _Size_type> inline
  _Size_type _Convert_size(const size_t _Len)
  { // convert size_t to _Size_type, avoiding truncation
  return (static_cast<_Size_type>(_Len));
  }

template<> inline
  size_t _Convert_size<size_t>(const size_t _Len) noexcept
  { // convert size_t to size_t, unchanged
  return (_Len);
  }

$ clang-cl Test.cpp -std:c++latest

Test.cpp(8,10):  warning: exception specification in declaration does not match
previous declaration
      [-Wmicrosoft-exception-spec]
  size_t _Convert_size<size_t>(const size_t _Len) noexcept
         ^
Test.cpp(8,10):  note: previous declaration is here
Test.cpp(8,10):  error: conflicting types for '_Convert_size'
  size_t _Convert_size<size_t>(const size_t _Len) noexcept
         ^
Test.cpp(8,10):  note: previous declaration is here
1 warning and 1 error generated.

Note how both notes are wrong. They don't have diagnostics, and point to the
same location of the error/warning.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to