[Bug sanitizer/95137] Sanitizers seem to be missing support for coroutines

2021-09-28 Thread niekb at scintilla dot utwente.nl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95137

--- Comment #43 from niek  ---
(In reply to Rafael Avila de Espindola from comment #29)
> Created attachment 48771 [details]
> Testcase without lambda coroutines
> 
> I modified the testcase to also build with clang and not depend on async
> lambdas. This still reproduces the problem with gcc with undefined behaviour
> sanitizer, but works with with clang and sanitizers and gcc with valgrind.

Hi Rafael,

I tried your testcase on GCC trunk today (2021-09-28), and the testcase now
seems to pass (!), even with asan and ubsan enabled.

I tested with Compiler Explorer, with options

  -std=c++20 -g -fcoroutines -fsanitize=address,undefined 

and with the "compile to binary" and "execute the code" options.

The only thing is that I had to include the  header; gcc was
complaining about not finding std::exchange.

Does this mean (and could you please reconfirm) that bug 95317 has disappeared
in trunk (which will become GCC 12)?

[Bug sanitizer/95137] Sanitizers seem to be missing support for coroutines

2021-02-09 Thread niekb at scintilla dot utwente.nl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95137

--- Comment #39 from niek  ---
I just tested this on the nightly build of GCC 11. Unfortunately, the issue is
still there...

@Richard Biener
Would it be a good idea to attach this bug's target milestone to GCC 11.1?
(instead of, or in addition to, GCC 10.3)

kind regards,
Niek

[Bug sanitizer/95137] Sanitizers seem to be missing support for coroutines

2020-08-12 Thread niekb at scintilla dot utwente.nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95137

niek  changed:

   What|Removed |Added

 CC||niekb at scintilla dot 
utwente.nl

--- Comment #34 from niek  ---
Dear Iain,

Any progress on this issue?

(The issue is still present in gcc-trunk...)

kind regards,
Niek

[Bug c++/94260] Specific friend function inside c++20 concept-constrained class template triggers 'not usable in a constant expression' error

2020-06-27 Thread niekb at scintilla dot utwente.nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94260

--- Comment #2 from niek  ---
Dear Patrick,

Nope, I cannot reproduce it anymore.
It seems to be fixed!


PS apologies for my delayed response; this is one of my public 'spam
email addresses', just saw it now.

best,
Niek

On 22/06/2020 15:45, ppalka at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94260
> 
> Patrick Palka  changed:
> 
>What|Removed |Added
> 
>Last reconfirmed||2020-06-22
>  Ever confirmed|0   |1
>  CC||ppalka at gcc dot gnu.org
>  Status|UNCONFIRMED |WAITING
> 
> --- Comment #1 from Patrick Palka  ---
> Thanks for the report.  I'm unable to reproduce this issue against GCC 10.1 or
> current trunk.  Are you still able to reproduce?
> 
> -- You are receiving this mail because: You reported the bug.

[Bug c++/94260] New: Specific friend function inside c++20 concept-constrained class template triggers 'not usable in a constant expression' error

2020-03-22 Thread niekb at scintilla dot utwente.nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94260

Bug ID: 94260
   Summary: Specific friend function inside c++20
concept-constrained class template triggers 'not
usable in a constant expression' error
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: niekb at scintilla dot utwente.nl
  Target Milestone: ---

Dear GCC-devs,

I stumbled upon the following error, while working with a particular friend
function inside a concepts-contrained templated class. I tried to make a
minimal example, but maybe it can be further slimmed down.

I am not sure if this is a bug in GCC; however, on clang-trunk the same code
compiles with no error. 

I've created examples on Godbolt's Compiler Explorer. The example on which
GCC-trunk fails is:
https://godbolt.org/z/fc3HbB

The same code compiles successfully with Clang-trunk:
https://godbolt.org/z/JiB_UB

The error disappears when removing the concept-constraint from the class
definition.
The error also disappears when turning the 'fun' function into an non-friend
function.


kind regards,
Niek


NB: I've also copy-pasted the source code below:


#include 
#include 
#include 

template
concept my_concept = std::regular;

template  
class wrapper
{
 T d;
 runtime_t& x;
public:
 wrapper(T&& data, runtime_t& runtime) : 
d(std::move(data)),
x(runtime) {}
T& fut()
{
return d;
}
runtime_t& runtime()
{
return x;
}
};


template
//template  // replacing the above line by this line
fixes the compilation error on GGC-trunk
class test {
public:
friend auto fun(wrapper,
test>& a,
wrapper,
test>& b)
-> wrapper, test>
{
return wrapper, test>
(   
std::async(std::launch::deferred, [a,b]() mutable { return
a.fut().get() + b.fut().get(); }),
a.runtime() 
);
}
};

int main(){
static_assert(std::regular);

test t;
std::shared_future f1 = std::async(std::launch::deferred, []() {
return 42; });
std::shared_future f2 = std::async(std::launch::deferred, []() {
return 42; });

wrapper, test> a(std::move(f1),t); 
wrapper, test> b(std::move(f2),t); 

fun(a, b);

}