[Bug c++/49399] [C++0x] substitution failure error

2011-06-15 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49399 Jason Merrill changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED CC|

[Bug c++/49399] [C++0x] substitution failure error

2011-06-14 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49399 --- Comment #9 from Jonathan Wakely 2011-06-14 12:40:52 UTC --- Note that returning 4 was *never* correct for that program. In C++03 it shouldn't compile and in C++0x it should return 1. There's a bug in the Boost.MPL docs which should say the

[Bug c++/49399] [C++0x] substitution failure error

2011-06-14 Thread jarrydb at cse dot unsw.edu.au
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49399 --- Comment #8 from Jarryd Beck 2011-06-14 12:35:31 UTC --- (In reply to comment #7) > (In reply to comment #6) > > (In reply to comment #4) > > > Ah, I see. Well the example you gave also doesn't compile. This is > > > exactly what > > > the bo

[Bug c++/49399] [C++0x] substitution failure error

2011-06-14 Thread jarrydb at cse dot unsw.edu.au
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49399 --- Comment #7 from Jarryd Beck 2011-06-14 12:34:35 UTC --- (In reply to comment #6) > (In reply to comment #4) > > Ah, I see. Well the example you gave also doesn't compile. This is exactly > > what > > the boost library does too, I missed that

[Bug c++/49399] [C++0x] substitution failure error

2011-06-14 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49399 --- Comment #6 from Jonathan Wakely 2011-06-14 12:30:06 UTC --- (In reply to comment #4) > Ah, I see. Well the example you gave also doesn't compile. This is exactly > what > the boost library does too, I missed that part in their code, meaning

[Bug c++/49399] [C++0x] substitution failure error

2011-06-14 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49399 --- Comment #5 from Jonathan Wakely 2011-06-14 12:27:35 UTC --- Then they never should have compiled in the first place, and won't compile with clang or Comeau either. http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1170 is the rele

[Bug c++/49399] [C++0x] substitution failure error

2011-06-14 Thread jarrydb at cse dot unsw.edu.au
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49399 --- Comment #4 from Jarryd Beck 2011-06-14 12:21:15 UTC --- (In reply to comment #3) > The program should not compile. > > In C++03 it should fail to compile because it accesses a private member. > SFINAE > does not take access control into acc

[Bug c++/49399] [C++0x] substitution failure error

2011-06-14 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49399 --- Comment #3 from Jonathan Wakely 2011-06-14 12:11:05 UTC --- The program should not compile. In C++03 it should fail to compile because it accesses a private member. SFINAE does not take access control into account in C++03, so that is an err

[Bug c++/49399] [C++0x] substitution failure error

2011-06-14 Thread jarrydb at cse dot unsw.edu.au
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49399 --- Comment #2 from Jarryd Beck 2011-06-14 11:52:58 UTC --- By works fine I mean that the code compiles, and when it runs, the program returns the number 4. Maybe I'm misunderstanding how this is all supposed to work and something has changed in

[Bug c++/49399] [C++0x] substitution failure error

2011-06-14 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49399 --- Comment #1 from Jonathan Wakely 2011-06-14 08:15:14 UTC --- when you say "works fine" do you mean "doesn't do the access check"? surely if SFINAE correctly honours access control then the function shouldn't be callable and the program won't c