clang icon indicating copy to clipboard operation
clang copied to clipboard

Crash on failed lookup

Open asutton opened this issue 7 years ago • 0 comments

Here's a small example that triggers the crash.

#include <cppx/meta>
#include <cppx/compiler>

using namespace cppx::meta;

struct date {
  int y;
  int m;
  int d;

  virtual void f() { }
};

int main() {
  std::cout << $date::f.is_virtual() << '\n';
}

The problem is that std::cout is not in scope, and the compiler is trying to adjust the "typo". The crash comes from a failed transformation of a template argument.

I strongly suspect that this is because we are not forming the template argument to the constructor to the type of the reflection correctly. It probably needs an actual expression, not just an APInt as the argument.

asutton avatar Apr 26 '17 19:04 asutton