[Bug c++/63609] New: incompatibility with C++11 standard on 14.5.6.2 Partial ordering of function templates

2014-10-21 Thread dccmmccd1 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63609

Bug ID: 63609
   Summary: incompatibility with C++11 standard on 14.5.6.2
Partial ordering of function templates
   Product: gcc
   Version: 4.8.3
Status: UNCONFIRMED
  Severity: blocker
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dccmmccd1 at gmail dot com

The following example is taken (with small modifications to make it compile)
from http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf 14.5.6.2
(item 3) :

#include 

struct A {};

template
struct B {
  template void operator*(R&) { // #1
std::cout << "1" << std::endl;
  }
};

template
void operator*(T&, R&) {  // #2
  std::cout << "2" << std::endl;
}

int main() {
  A a;
  B b;
  b * a; //should print 1
}

Unless this was removed from the final c++11 standard I believe this has to be
legal c++ code, but g++ (4.8.3) gives the following error:
test_templates.cpp: In function ‘int main()’:
test_templates.cpp:20:5: error: ambiguous overload for ‘operator*’ (operand
types are ‘B’ and ‘A’)
   b * a; //should print 1
 ^
test_templates.cpp:20:5: note: candidates are:
test_templates.cpp:7:26: note: void B::operator*(R&) [with R = A; T = A]
   template void operator*(R&) {   // #1
  ^
test_templates.cpp:13:6: note: void operator*(T&, R&) [with T = B; R = A]
 void operator*(T&, R&) {  // #2

[Bug c++/63609] incompatibility with C++11 standard on 14.5.6.2 Partial ordering of function templates

2014-10-22 Thread dccmmccd1 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63609

--- Comment #2 from dccmmccd1 at gmail dot com ---
(In reply to Jonathan Wakely from comment #1)
> Please don't set severity=blocker just because you think it's quite
> important to you. We're not going to block a GCC release for this issue,
> especially since it's been present in several releases already!

As this is the first time I report a gcc bug, I didn't really understand the
meaning of severity here. I was under the impression it meant something very
different. After a bit of investigation I know see that normal is much more
appropriate here.