bloomberg / clang-p2996

Experimental clang support for WG21 P2996 (Reflection).
https://github.com/bloomberg/clang-p2996/tree/p2996/P2996.md
51 stars 8 forks source link

Clang frontend failed #63

Closed Yaraslaut closed 2 months ago

Yaraslaut commented 2 months ago

Describe the bug Parses crashes when trying to compile following code

template<typename T>
constexpr void foo() {
  [:expand(template_arguments_of(^T)):] >> [&]<auto mem> {};
}

static_assert(template_arguments_of(^std::variant<short,int,long,float>).size() == 4);

int main() {

    foo<std::variant<short,int,long>>();
    foo<std::variant<short,int,long,float>>(); // crash
    return 0;
}

To Reproduce Steps to reproduce the behavior: https://godbolt.org/z/G8qqas6dh

katzdm commented 2 months ago

Thanks for the bug report, @Yaraslaut ! This will be fixed on Godbolt tomorrow.