[Bug c++/99209] lambdas in function template signatures instantiated with wrong semantic context

2022-09-08 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99209

Patrick Palka  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=105652
   Target Milestone|--- |12.2
 Resolution|--- |FIXED
 CC||ppalka at gcc dot gnu.org

--- Comment #4 from Patrick Palka  ---
This appears to be fixed for GCC 12.2/trunk by the fix for PR105652.

[Bug c++/99209] lambdas in function template signatures instantiated with wrong semantic context

2022-09-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99209

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Patrick Palka :

https://gcc.gnu.org/g:f7280b04714c24af2854cf020b6e7b6ad3b7fba8

commit r13-2542-gf7280b04714c24af2854cf020b6e7b6ad3b7fba8
Author: Patrick Palka 
Date:   Thu Sep 8 10:49:04 2022 -0400

c++: Add testcase for already fixed PR [PR99209]

This was incidentally fixed by r13-806-g221acd67ca50f8.

PR c++/99209

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/lambda-uneval17.C: New test.

[Bug c++/99209] lambdas in function template signatures instantiated with wrong semantic context

2021-03-03 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99209

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org
   Last reconfirmed||2021-03-03
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

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

[Bug c++/99209] lambdas in function template signatures instantiated with wrong semantic context

2021-02-22 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99209

--- Comment #1 from Richard Smith  ---
Here's a more interesting example: https://godbolt.org/z/83c36q


#include 

constexpr char f(...) { return 'g'; }
constexpr decltype(auto) f_adl(auto a) { return f(a); }

namespace A {
constexpr char f(auto) { return 'A'; }
template void g(char FunctionParam =
f_adl([]{})) {
char Local = f_adl([]{});
std::cout << TemplateParam << FunctionParam << Local;
}
}

namespace B {
constexpr char f(auto) { return 'B'; }
void call() { A::g(); }
}

int main() { B::call(); }


This prints 'BgA', but should print 'AAA'. So the three lambdas actually
exhibit three different behaviors, not two.