[Bug c++/49066] [C++0x] Non-defining declaration of deleted function suppresses usage validation

daniel.kruegler at googlemail dot com gcc-bugzilla@gcc.gnu.org
Thu May 19 19:40:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49066

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2011-05-19 19:06:15 UTC ---
I found another example that convinces me that the current behaviour is a real
bug and that this issue is not just an enhancement request. Consider this
example:

//---
void foo() = delete;
void foo();

template<class = decltype(foo())>
void bar(){}

int main() { bar(); }
//---

Without the second non-defining declaration of foo(), the program would be
clearly rejected, but with the second declaration it is accepted. This code
should be rejected independent of the existence of the second declaration of
foo().



More information about the Gcc-bugs mailing list