[Bug c++/93083] copy deduction rejected when doing CTAD for NTTP

2020-11-17 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93083

--- Comment #5 from Marek Polacek  ---
Short test from Bug 97751:

template 
struct use_as_nttp {};

template 
struct has_nttp {};

template 
using has_nttp_2 = has_nttp;

[Bug c++/93083] copy deduction rejected when doing CTAD for NTTP

2020-11-17 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93083

Marek Polacek  changed:

   What|Removed |Added

 CC||janpmoeller at gmx dot de

--- Comment #4 from Marek Polacek  ---
*** Bug 97751 has been marked as a duplicate of this bug. ***

[Bug c++/93083] copy deduction rejected when doing CTAD for NTTP

2020-10-13 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93083

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2020-10-13

--- Comment #3 from Marek Polacek  ---
Confirmed.

[Bug c++/93083] copy deduction rejected when doing CTAD for NTTP

2020-05-20 Thread hanicka at hanicka dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93083

--- Comment #2 from Hana Dusíková  ---
Same error is also triggered by template partial specialization:

```
template  struct literal {
constexpr literal(const char ()[N]) noexcept { }
constexpr literal(const literal &) noexcept { }
};

template  struct field { };

template  struct field { };
```

[Bug c++/93083] copy deduction rejected when doing CTAD for NTTP

2020-01-26 Thread martijntje at martijnotto dot nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93083

Martijn Otto  changed:

   What|Removed |Added

 CC||martijntje at martijnotto dot 
nl

--- Comment #1 from Martijn Otto  ---
The problem with deducing N is a stubborn one. I have run into the same issue
and tried to fix it by adding a constexpr size() method to explicitly provide
the size, but it doesn't seem to help and fails with the same error message
about being unable to deduce N:

template
struct FixedString
{
char buf[N + 1]{};
constexpr FixedString(char const* s) {
for (unsigned i = 0; i != N; ++i) buf[i] = s[i];
}

auto operator<=>(const FixedString&) const = default;
constexpr operator char const*() const { return buf; }
constexpr static unsigned size() noexcept { return N; }
};

template FixedString(char const (&)[N]) -> FixedString;

template 
struct name_list
{
template 
using add_name = name_list<
names...,
FixedString{ name }
>;
};


int main()
{
using names =
name_list<>
::add_name<"Zaphod Beeblebrox">;

}