[Bug c++/29236] [4.0/4.1/4.2 Regression] Bogus ambiguity with templates + friend

2007-11-01 Thread jason at gcc dot gnu dot org


--- Comment #16 from jason at gcc dot gnu dot org  2007-11-02 05:59 ---
Fixed for 4.3.0.


-- 

jason at gcc dot gnu dot org changed:

   What|Removed |Added

  Known to work|2.95|2.95 4.3.0
Summary|[4.0/4.1/4.2/4.3 Regression]|[4.0/4.1/4.2 Regression]
   |Bogus ambiguity with|Bogus ambiguity with
   |templates + friend  |templates + friend


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



[Bug c++/29236] [4.0/4.1/4.2 Regression] Bogus ambiguity with templates + friend

2006-10-20 Thread pinskia at gcc dot gnu dot org


--- Comment #10 from pinskia at gcc dot gnu dot org  2006-10-20 07:33 
---
*** Bug 29486 has been marked as a duplicate of this bug. ***


-- 


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



[Bug c++/29236] [4.0/4.1/4.2 Regression] Bogus ambiguity with templates + friend

2006-10-20 Thread pinskia at gcc dot gnu dot org


--- Comment #11 from pinskia at gcc dot gnu dot org  2006-10-20 07:34 
---
*** Bug 29438 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||pcarlini at suse dot de


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



[Bug c++/29236] [4.0/4.1/4.2 Regression] Bogus ambiguity with templates + friend

2006-10-16 Thread mmitchel at gcc dot gnu dot org


--- Comment #8 from mmitchel at gcc dot gnu dot org  2006-10-16 18:36 
---
The problem here is that tsubst, for a TEMPLATE_TEMPLATE_PARM, reduces the
parameter level for the new TEMPLATE_TEMPLATE_PARM (via a call to
reduce_template_parm_level), but does not reset
TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL to a substituted version of the template. 
Therefore, when we consider merging the friend declaration and the global
declaration, we think that there types are different.


-- 

mmitchel at gcc dot gnu dot org changed:

   What|Removed |Added

   Last reconfirmed|2006-10-10 04:11:45 |2006-10-16 18:36:50
   date||


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



[Bug c++/29236] [4.0/4.1/4.2 Regression] Bogus ambiguity with templates + friend

2006-10-16 Thread bangerth at math dot tamu dot edu


--- Comment #9 from bangerth at math dot tamu dot edu  2006-10-17 01:49 
---
Subject: Re:  [4.0/4.1/4.2 Regression] Bogus ambiguity with
 templates + friend


 TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL

If I didn't know better, this would sure sound like something written
under the influence :-)

-
Wolfgang Bangerthemail:[EMAIL PROTECTED]
 www: http://www.math.tamu.edu/~bangerth/


-- 


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



[Bug c++/29236] [4.0/4.1/4.2 Regression] Bogus ambiguity with templates + friend

2006-10-11 Thread mmitchel at gcc dot gnu dot org


-- 

mmitchel at gcc dot gnu dot org changed:

   What|Removed |Added

   Priority|P2  |P1


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



[Bug c++/29236] [4.0/4.1/4.2 Regression] Bogus ambiguity with templates + friend

2006-10-10 Thread rguenth at gcc dot gnu dot org


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||rguenth at gcc dot gnu dot
   ||org
  Known to fail|3.2.3 3.3.5 3.4.6 4.0.1 |3.2.3 3.3.5 3.4.6 4.0.3
   |4.1.1 4.2.0 3.0.4   |4.1.1 4.2.0 3.0.4
Summary|[4.0/4.1/4.2? regression]   |[4.0/4.1/4.2 Regression]
   |Bogus ambiguity with|Bogus ambiguity with
   |templates + friend  |templates + friend
   Target Milestone|4.2.0   |4.0.4


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



[Bug c++/29236] [4.0/4.1/4.2 Regression] Bogus ambiguity with templates + friend

2006-10-10 Thread bangerth at dealii dot org


--- Comment #6 from bangerth at dealii dot org  2006-10-10 14:25 ---
(In reply to comment #5)
 foo should not have been injected by the friend.

True, but that's irrelevant here. We get a tentative declaration that we
simply have to unify with the later real declaration.


 Note the Priority should be only changed by the release manager.

We've been over that before, Andrew. It has always been the case that
bugmasters do the initial triage, including setting an initial priority.
We've done that at least back to 2002, when we were still using GNATS instead
of bugzilla. It is also true that the RM has the prerogative to downgrade
priorities if he doesn't deem things that important. 

I maintain that it is important to raise the priority of PRs that are
rejects-valid so that they get some visibility, and in particular of
regressions. If someone higher up in the food chain thinks otherwise
wants to downgrade things, that's fine by me. But it's not productive
if bugmasters quarrel among themselves if something should be a P2 or a
P3 ...

W.


-- 

bangerth at dealii dot org changed:

   What|Removed |Added

 CC||mmitchel at gcc dot gnu dot
   ||org
   Priority|P3  |P2


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



[Bug c++/29236] [4.0/4.1/4.2 Regression] Bogus ambiguity with templates + friend

2006-10-10 Thread mark at codesourcery dot com


--- Comment #7 from mark at codesourcery dot com  2006-10-10 16:23 ---
Subject: Re:  [4.0/4.1/4.2 Regression] Bogus ambiguity with
 templates + friend

bangerth at dealii dot org wrote:

 We've been over that before, Andrew. It has always been the case that
 bugmasters do the initial triage, including setting an initial priority.
 We've done that at least back to 2002, when we were still using GNATS instead
 of bugzilla. It is also true that the RM has the prerogative to downgrade
 priorities if he doesn't deem things that important. 

I have asked that all bugs be left at P3, and that I set their initial 
priority.  I also welcome input about what the priority should be, 
ideally in the audit trail for the PR itself.  But, looking at P3 bugs 
is how I see what the new bugs are.

Thanks,


-- 


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



[Bug c++/29236] [4.0/4.1/4.2? regression] Bogus ambiguity with templates + friend

2006-10-09 Thread bangerth at dealii dot org


--- Comment #3 from bangerth at dealii dot org  2006-10-10 04:11 ---
Confirmed:
--
template typename T struct A {};

template template typename class P
struct B {
template template typename class Q
friend bool foo (const BQ a);
};

template template typename class Q
bool foo (const BQ a);

void bar () {
  BA a;
  foo (a);
}
--

g/x /home/bangerth/bin/gcc-4.2-pre/bin/c++ -c x.cc
x.cc: In function #8216;void bar()#8217;:
x.cc:14: error: call of overloaded #8216;foo(BA)#8217; is ambiguous
x.cc:10: note: candidates are: bool foo(const BQ) [with Q = A]
x.cc:6: note: bool foo(const BQ) [with Q = A, P = A]


icc accepts the code. I believe we simply forget to unify the tentative
declaration from the friend declaration with the real template once we
encounter it, and end up with two declarations instead of one. We then
get confused when we have to pick one of the two.

This is a regression introduced in 3.2 over 2.95.

W.


-- 

bangerth at dealii dot org changed:

   What|Removed |Added

 CC||bangerth at dealii dot org
 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Keywords||rejects-valid
  Known to fail||3.2.3 3.3.5 3.4.6 4.0.1
   ||4.1.1 4.2.0
  Known to work||2.95
   Priority|P3  |P2
   Last reconfirmed|-00-00 00:00:00 |2006-10-10 04:11:45
   date||
Summary|Friend operators for class  |[4.0/4.1/4.2? regression]
   |with template in template   |Bogus ambiguity with
   |argument does not compile   |templates + friend
   Target Milestone|--- |4.2.0


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



[Bug c++/29236] [4.0/4.1/4.2? regression] Bogus ambiguity with templates + friend

2006-10-09 Thread bangerth at dealii dot org


--- Comment #4 from bangerth at dealii dot org  2006-10-10 04:13 ---
btw, this only happens if Q is really a template template argument. As noted
by the original reporter, the problem goes away if Q is simply a template
argument.

W.


-- 


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



[Bug c++/29236] [4.0/4.1/4.2? regression] Bogus ambiguity with templates + friend

2006-10-09 Thread pinskia at gcc dot gnu dot org


--- Comment #5 from pinskia at gcc dot gnu dot org  2006-10-10 04:31 ---
foo should not have been injected by the friend.
Note the Priority should be only changed by the release manager.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

  Known to fail|3.2.3 3.3.5 3.4.6 4.0.1 |3.2.3 3.3.5 3.4.6 4.0.1
   |4.1.1 4.2.0 |4.1.1 4.2.0 3.0.4
   Priority|P2  |P3


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