Flylint cuts usefull info from an issue found
randrewy opened this issue · 0 comments
randrewy commented
Given the following example:
// main.cpp
#include <vector>
#include "header.h"
int main() {
test<int>();
}
// header.h
template<typename T>
bool test() {
T min = std::numeric_limits<T>::min();
size_t x = 0;
return x > min; // signed/unsigned comparison here, but real issue is cut from output
}
Compiling it with -Wsign-compare
gives this warning that spans over two lines:
$ clang++ -std=c++20 -stdlib=libc++ -Wsign-compare src/main.cpp
In file included from src/main.cpp:2:
src/header.h:9:14: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
return x > min;
~ ^ ~~~
src/main.cpp:6:5: note: in instantiation of function template specialization 'test<int>' requested here
test<int>();
^
1 warning generated.
However output is cut down to this, making it impossible to understand the issue