public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/102680] New: lambda-expression in template-argument plus templateed using leads to further using-directive being ignored within template scope
@ 2021-10-10 17:59 hq.ks at web dot de
  2021-10-10 18:56 ` [Bug c++/102680] " hq.ks at web dot de
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: hq.ks at web dot de @ 2021-10-10 17:59 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102680
           Summary: lambda-expression in template-argument plus templateed
                    using leads to further using-directive being ignored
                    within template scope
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hq.ks at web dot de
  Target Milestone: ---

Created attachment 51581
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51581&action=edit
minimalist reproducer

Take:
0) a class template with two arguments
1) a templated using-directive containing a lambda-expression as a template
parameter to (0)
2) a using declaration within another template scope, which depends on template
parameters and makes use of (1)
3) any use of the type alias defined by (2)

With GCC 9.4.0, from my observation, the behavior is identical to the using
directive (2) not being there at all: it will complain about the alias not
naming a type, and if a conflicting definition of the same type is added, it
will accept it. (It will parse the RHS of (2) for errors, though.)

-Wall -Wextra does not turn up any warnings.

Generally, I would expect exactly one of the following to happen:
a) (2) gives a compiler error
b) Below (2), and in its scope, the alias is usable as a type name. 

I am not a C++ language lawyer, so I can't really vouch that my reproducer is
in fact valid C++20, but even if it is not, the principle of least surprise
would imply raising an error at (2). 

Cheers,
   Philipp

 > g++ --version # compiled from tarball
g++ (GCC) 9.4.0

 > uname -a
Linux hostname 4.9.0-15-amd64 #1 SMP Debian 4.9.258-1 (2021-03-08) x86_64
GNU/Linux

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

* [Bug c++/102680] lambda-expression in template-argument plus templateed using leads to further using-directive being ignored within template scope
  2021-10-10 17:59 [Bug c++/102680] New: lambda-expression in template-argument plus templateed using leads to further using-directive being ignored within template scope hq.ks at web dot de
@ 2021-10-10 18:56 ` hq.ks at web dot de
  2021-10-10 18:57 ` hq.ks at web dot de
  2024-04-15 22:33 ` ppalka at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: hq.ks at web dot de @ 2021-10-10 18:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from hq.ks at web dot de ---
https://www.overleaf.com/learn/latex/Matrices

On 10/10/2021 20.51, pinskia at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102680
>
> Andrew Pinski <pinskia at gcc dot gnu.org> changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>             Keywords|                            |accepts-invalid,
>                     |                            |rejects-valid
>

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

* [Bug c++/102680] lambda-expression in template-argument plus templateed using leads to further using-directive being ignored within template scope
  2021-10-10 17:59 [Bug c++/102680] New: lambda-expression in template-argument plus templateed using leads to further using-directive being ignored within template scope hq.ks at web dot de
  2021-10-10 18:56 ` [Bug c++/102680] " hq.ks at web dot de
@ 2021-10-10 18:57 ` hq.ks at web dot de
  2024-04-15 22:33 ` ppalka at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: hq.ks at web dot de @ 2021-10-10 18:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from hq.ks at web dot de ---
Ooops, terribly sorry, wanted to send that to someone else.


On 10/10/2021 20.56, Philipp Klenze wrote:
> https://www.overleaf.com/learn/latex/Matrices
> 
> On 10/10/2021 20.51, pinskia at gcc dot gnu.org wrote:
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102680
>>
>> Andrew Pinski <pinskia at gcc dot gnu.org> changed:
>>
>>             What    |Removed                     |Added
>> ---------------------------------------------------------------------------- 
>>
>>             Keywords|                            |accepts-invalid,
>>                     |                            |rejects-valid
>>

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

* [Bug c++/102680] lambda-expression in template-argument plus templateed using leads to further using-directive being ignored within template scope
  2021-10-10 17:59 [Bug c++/102680] New: lambda-expression in template-argument plus templateed using leads to further using-directive being ignored within template scope hq.ks at web dot de
  2021-10-10 18:56 ` [Bug c++/102680] " hq.ks at web dot de
  2021-10-10 18:57 ` hq.ks at web dot de
@ 2024-04-15 22:33 ` ppalka at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-04-15 22:33 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |c++-lambda
   Target Milestone|---                         |14.0
         Resolution|---                         |FIXED
                 CC|                            |ppalka at gcc dot gnu.org
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #3 from Patrick Palka <ppalka at gcc dot gnu.org> ---
This seems fixed for GCC 14 after r14-9943-gd74fe10b13336b.

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

end of thread, other threads:[~2024-04-15 22:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-10 17:59 [Bug c++/102680] New: lambda-expression in template-argument plus templateed using leads to further using-directive being ignored within template scope hq.ks at web dot de
2021-10-10 18:56 ` [Bug c++/102680] " hq.ks at web dot de
2021-10-10 18:57 ` hq.ks at web dot de
2024-04-15 22:33 ` 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).