Open Quuxplusone opened 9 years ago
Attached polynomial_optimization_test-e0a786.sh
(678 bytes, application/x-sh): generation script
Attached polynomial_optimization_test-e0a786.cpp.gz
(673837 bytes, application/x-gzip): source code
reduction:
template <bool>
struct enable_if;
struct A {
typedef int type;
struct type_list {};
};
template <typename... TTags>
struct tuple_tags {
typedef A::type_list tags;
template <typename TTag>
using index_of = tags;
};
template <typename... Args>
struct tagged_tuple {
typedef tuple_tags<typename Args::tag...> tags;
};
template <typename... TTags>
tagged_tuple<tagged_tuple<TTags>...> make_tagged_tuple();
struct ValueA;
template <class Constraints,
enable_if<Constraints::tags::template index_of<ValueA> == 0> = 0>
void minimize_constrained_quadratic(Constraints) {
minimize_constrained_quadratic(make_tagged_tuple());
}
It could be better though...
Hit this (or something very like it) today - my reduced test code below.
Running a recent debug build, both the reduced test code posted above as well
as my own seem to fail with:
llvm/include/llvm/Support/Casting.h:237:
typename cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X =
clang::FunctionTemplateDecl, Y = clang::NamedDecl]: Assertion `isa<X>(Val) &&
"cast<Ty>() argument of incompatible type!"' failed.
$ clang++ -v
clang version 3.8.0 (http://llvm.org/git/clang.git
3490ab8630d5643f71f1f04e46984f05b27b8d67) (http://llvm.org/git/llvm.git
d2643e2ff955ed234944fe3c6b4ffc1250085843)
Target: x86_64-unknown-linux-gnu
Thread model: posix
...
template <typename T> struct A {
static const int value = T::template F_t<int>; //nonsense
};
struct B {
template <typename T> struct F { using type = T;};
template <typename T> using F_t = typename F<T>::type;
};
int main() {
return A<B>::value;
}
polynomial_optimization_test-e0a786.sh
(678 bytes, application/x-sh)polynomial_optimization_test-e0a786.cpp.gz
(673837 bytes, application/x-gzip)attached source and generation script