view gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-neg2.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 1830386684a0
children
line wrap: on
line source

// PR c++/88095
// Test class non-type template parameters for literal operator templates.
// Validate that non-literal class types are rejected.
// { dg-do compile { target c++2a } }

struct non_literal_class {
  constexpr non_literal_class(...) { }
  ~non_literal_class() {}
  // auto operator<=> (const non_literal_fixed_string&) = default;
};

template <non_literal_class> // { dg-error "11:is not a valid type for a template non-type parameter because it is not structural" }
int operator"" _udl();       // { dg-error "5:literal operator template .int operator\"\"_udl\\(\\). has invalid parameter list" }