Sarcasm / flycheck-irony

C, C++ and Objective-C support for Flycheck, using Irony Mode
56 stars 10 forks source link

Error in included files should be reported on the checked buffer #6

Open Sarcasm opened 9 years ago

Sarcasm commented 9 years ago

See discussion https://github.com/flycheck/flycheck/issues/548#issuecomment-77845737

Errors that appears in the included file and not in the main file is common in C++, for example (not tested but shows the idea):

foo.h

template <class T>
void blah()
{
    static_assert(std::is_copy_constructible<T>::value, "blah error"); // ERROR here
}

foo.cpp

#include "foo.h"

#include <ffstream>

void foo()
{
    blah<std::ifstream>(); // No error here, static assertion is in header file
}