public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101725] New: simple requirement of parameter in defaulted non-type template parameter considered non-dependent
@ 2021-08-02 13:46 johelegp at gmail dot com
  2021-08-03 16:35 ` [Bug c++/101725] " ppalka at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: johelegp at gmail dot com @ 2021-08-02 13:46 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101725
           Summary: simple requirement of parameter in defaulted non-type
                    template parameter considered non-dependent
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: johelegp at gmail dot com
                CC: johelegp at gmail dot com
  Target Milestone: ---

See https://godbolt.org/z/fer6on13z.
```C++
template<class T, bool V = (requires(T t) { x(t); })> constexpr bool
can_x_yet{V};
template<class T, bool V = (requires { y(*(T*)(0)); })> constexpr bool
can_y_yet{V};
```
The first line fails with:
```
<source>:1:47: error: parameter 't' may not appear in this context
    1 | template<class T, bool V = (requires(T t) { x(t); })> constexpr bool
can_x_yet{V};
      |                                               ^
<source>:1:45: error: there are no arguments to 'x' that depend on a template
parameter, so a declaration of 'x' must be available [-fpermissive]
    1 | template<class T, bool V = (requires(T t) { x(t); })> constexpr bool
can_x_yet{V};
      |                                             ^
<source>:1:45: note: (if you use '-fpermissive', G++ will accept your code, but
allowing the use of an undeclared name is deprecated)
Compiler returned: 1
```

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-09-15 18:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-02 13:46 [Bug c++/101725] New: simple requirement of parameter in defaulted non-type template parameter considered non-dependent johelegp at gmail dot com
2021-08-03 16:35 ` [Bug c++/101725] " ppalka at gcc dot gnu.org
2021-08-11 20:55 ` cvs-commit at gcc dot gnu.org
2021-08-11 21:41 ` cvs-commit at gcc dot gnu.org
2021-08-11 21:42 ` ppalka at gcc dot gnu.org
2021-09-15 18:24 ` ppalka at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).