https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61648
Bug ID: 61648
Summary: g++ accepts literal operator friends for non-template
classes but not for *template* classes
Product: gcc
Version: 4.10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: emsr at gcc dot gnu.org
This came from stackoverflow:
http://stackoverflow.com/questions/24465229/how-to-declare-friend-user-defined-literal-operator-within-template-class
clang++ takes this:
#include <cstddef>
struct B{};
B operator+(B, B) { return B(); }
B operator"" _b(const char *, size_t) { return B(); }
template<typename T>
class C
{
friend B operator+(B, B);
friend B operator"" _b(const char *, size_t);
};
int main() { return 0; }