Why static_assert calls in unused template methods in LLVM

61 views Asked by At

I have next structure of project like this:

Utils.h

template<typename T>
T test() {
  static_assert(false, "Test calls");
}
...

Handle.h

#include "Utils.h" // but not call test()
... // something code

Main.cpp

#include "Utils.h" // but not call test()
int main { ... // something code

But when I compile it, I get static_assert. Why? Because it should not be compiled

I use Xcode 6.3.2

0

There are 0 answers