Ticket #2294: boost-optional-explicit-failures-markup-issue2294.diff
File boost-optional-explicit-failures-markup-issue2294.diff, 2.7 KB (added by , 12 years ago) |
---|
-
status/explicit-failures-markup.xml
2547 2547 <toolset name="gcc-3.4.6_linux_ia64"/> 2548 2548 <toolset name="gcc-4.2.*"/> 2549 2549 <toolset name="gcc-4.1.2_sunos_i86pc"/> 2550 <note author="Fernando Cacciola" refid="2"/> 2550 <note author="Fernando Cacciola" id="optional-compiler-bug"> 2551 <p>This failure is caused by a compiler bug, and as far as we can 2552 tell, can't be worked around in the library, although we think 2553 the library might be made safer with respect to this bug.</p> 2554 2555 <p>Specifics: the following simple test fails when it should succeed.</p> 2556 <pre> 2557 #include <cassert> 2558 2559 int const x = 0; 2560 struct A 2561 { 2562 A(int const& y) 2563 { 2564 assert(&x == &y); 2565 } 2566 }; 2567 2568 int main() 2569 { 2570 A a(x); // direct initialization works fine 2571 A b = x; // copy initialization causes x to be copied before it is bound 2572 } 2573 </pre> 2574 2575 The possible safety enhancement would be to cause the constructor 2576 in question to be explicit for optional<T const&>; that 2577 would prevent copy initialization. 2578 </note> 2551 2579 </mark-expected-failures> 2552 2580 <mark-expected-failures> 2553 2581 <test name="optional_test_ref_fail1"/> 2554 2582 <toolset name="borland-5.6*"/> 2555 2583 <toolset name="borland-5.8*"/> 2556 2584 <toolset name="borland-5.9*"/> 2557 <note author="Fernando Cacciola" refid=" 2"/>2585 <note author="Fernando Cacciola" refid="optional-compiler-bug"/> 2558 2586 </mark-expected-failures> 2559 2587 <mark-expected-failures> 2560 2588 <test name="optional_test_fail3a"/> 2561 2589 <toolset name="gcc-3_3-darwin"/> 2562 <note author="Fernando Cacciola" refid=" 2"/>2590 <note author="Fernando Cacciola" refid="optional-compiler-bug"/> 2563 2591 </mark-expected-failures> 2564 2592 <mark-expected-failures> 2565 2593 <test name="optional_test_inplace_fail2"/> 2566 2594 <toolset name="gcc-3_3-darwin"/> 2567 <note author="Fernando Cacciola" refid=" 2"/>2595 <note author="Fernando Cacciola" refid="optional-compiler-bug"/> 2568 2596 </mark-expected-failures> 2569 2597 <mark-expected-failures> 2570 2598 <test name="optional_test"/>