[Bug c++/51107] New: [C++11] Accepts invalid literal operator with void argument list.
3dw4rd at verizon dot net
gcc-bugzilla@gcc.gnu.org
Sat Nov 12 18:53:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51107
Bug #: 51107
Summary: [C++11] Accepts invalid literal operator with void
argument list.
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: 3dw4rd@verizon.net
Created attachment 25809
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25809
Test case that should fail every which way.
I found that a non-template literal operator with no arguments is accepted by
g++.
#include <cassert>
// This argument list should not be allowed but is.
int
operator"" _foo()
{ return 66; }
int
main()
{
assert(operator"" _foo() == 66); // This is bad!
}
More information about the Gcc-bugs
mailing list