This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52521] New: [C++11] user defined literals and order of declaration
- From: "marc.glisse at normalesup dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 07 Mar 2012 13:59:34 +0000
- Subject: [Bug c++/52521] New: [C++11] user defined literals and order of declaration
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52521
Bug #: 52521
Summary: [C++11] user defined literals and order of declaration
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: marc.glisse@normalesup.org
#include <cstdlib>
int operator "" _w(const char*);
int operator "" _w(const char*, std::size_t);
int main() {
123_w;
}
a.cc: In function 'int main()':
a.cc:5:3: error: unable to find numeric literal operator 'operator"" _w'
The problem disappears if I switch the 2 declarations...
Btw, mangling these operators like functions called li_w taking the same
arguments is strange, I could have such a function in my code.