https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104031

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I can remove std::string but not figure out how to remove std::vector yet:
#include <vector>
#include <stddef.h>

struct string
{
  string(int){}
};

struct allocator
{
  allocator(){}
};

struct vector
{
  vector(allocator t = allocator{}){}
  vector(string, allocator t = allocator{}){}
  vector(std::initializer_list<string>&, allocator t = allocator{}){}
};

#if 1
typedef std::vector<string> t;
#else
typedef vector t;
#endif

struct Info {
    t args;
    int arity;
};

struct RegisterPrimOp
{
    RegisterPrimOp(Info && info) __attribute__((noipa, noinline)) {
        if (info.arity != 0)
            __builtin_trap();
    }
};

static RegisterPrimOp s_op({
    .args = {1},
    .arity = 0,
});

int main() {}

Reply via email to