https://bugs.llvm.org/show_bug.cgi?id=49375

Heiko Lewin <heiko.le...@worldiety.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

--- Comment #2 from Heiko Lewin <heiko.le...@worldiety.de> ---
Sorry, again. This worked with numbers.
This case prints "floatint" even with my local clang.
I am not proficient enough to be 100% sure if the "const auto&" is allowed to
bind to the "int&& or float&&" but the result is kinda ridiculous.

```
#include <tuple>


struct Test {
   int m_x;
   float m_y;

   template<class Callable>
   void withMembers(Callable&& callable) {
     callable(m_x, m_y);
   }
};


#include <stdio.h>
extern void print(int&&i) {
        printf("int");
}

extern void print(float&&i)  {
        printf("float");
}



int main()
{
    Test t{ .m_x=1, .m_y=2.0f};
    auto f = [](const int& arg) {
        print(arg);
    };


    t.withMembers([](const auto&... args){
        (  print(args), ...);
    });
    return t.m_x;
}
```

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to