[Bug c++/58820] lambda multiple inheritance operator() not ambiguous

2021-08-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58820

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Blocks|54367   |
 Status|NEW |RESOLVED

--- Comment #6 from Andrew Pinski  ---
Unrelated to lambdas really.  Here is a C++98 code which shows the same issue
with clang:
template
struct i
{
t operator()(t i);
};
struct overload_set1 : i, i
{
  overload_set1() {}
};
int main(void)
{
  double d1 = 10;
  overload_set1 tt;
  tt(d1);
}


To make the original code work (you need C++17 really):
Adding
  using Fs::operator()...;
allows GCC (and ICC) to work.

So this is a bug in clang.
I don't think we need a testcase as we must likely already have a C++98 one
even.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54367
[Bug 54367] [meta-bug] lambda expressions

[Bug c++/58820] lambda multiple inheritance operator() not ambiguous

2018-03-02 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58820

--- Comment #5 from Paolo Carlini  ---
Barring further comments, I'm going to add a testcase and close this.
(Note, current clang still accepts it)

[Bug c++/58820] lambda multiple inheritance operator() not ambiguous

2017-10-04 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58820

Paolo Carlini  changed:

   What|Removed |Added

 CC||paolo.carlini at oracle dot com

--- Comment #4 from Paolo Carlini  ---
Daniel, is there agreement now about this bug?

[Bug c++/58820] lambda multiple inheritance operator() not ambiguous

2017-06-10 Thread rs2740 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58820

TC  changed:

   What|Removed |Added

 CC||rs2740 at gmail dot com

--- Comment #3 from TC  ---
This should be closed as invalid. The lookup for `operator()` is indeed
ambiguous, (see [class.member.lookup]/6 - the merge produces an invalid set),
and GCC correctly reports it as such.

In the absence of using-declarations, names from different base classes don't
overload.

[Bug c++/58820] lambda multiple inheritance operator() not ambiguous

2013-10-21 Thread daniel.kruegler at googlemail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58820

--- Comment #1 from Daniel Krügler daniel.kruegler at googlemail dot com ---
This looks like a more fundamental name lookup problem of gcc to me. It can be
reproduced with function object types that are no lambda closures:

template class... Fs 
struct overload_set : Fs...
{
  overload_set(Fs... f)
: Fs(f)...
  {}  
};

template class... Fs 
overload_setFs... overload(Fs... x)
{
  return overload_setFs...(x...);
}

templateclass T
struct Closure 
{
  void operator()(T) const {}
  using FPtr = void(*)(T);
  operator FPtr() const;
};

int main()
{
  double d = 10; 
  overload(
  Closureint(),
  Closuredouble(),
  Closurechar() 
)(d);
}

[Bug c++/58820] lambda multiple inheritance operator() not ambiguous

2013-10-21 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58820

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2013-10-21
 Blocks|54367   |
 Ever confirmed|0   |1

--- Comment #2 from Paolo Carlini paolo.carlini at oracle dot com ---
Thanks Daniel. Could even be a duplicate then.