[patch] missing template argument in __weak_ptr::lock

Jonathan Wakely jwakely.gcc@gmail.com
Mon Sep 10 15:15:00 GMT 2007


Hi everyone,

__weak_ptr<Tp, Lp>::lock() cannot be instantiated when Lp !=
__default_lock_policy, as shown by the second of these new tests. The
other test is to ensure something similar doesn't happen with
__shared_ptr.

The errors are of the form:
/src/gcc/build/x86_64-unknown-linux-gnu/libstdc++-v3/include/tr1_impl/boost_shared_ptr.h:859:
error: conversion from 'std::tr1::__shared_ptr<int, _S_atomic>' to
non-scalar type 'std::tr1::__shared_ptr<int, _S_single>' requested

Are the new tests OK?  There is no explicit instantiation for
__shared_ptr<void, Lp> because its operator* can't be instantiated.

tested x86_64/linux, OK for mainline?
I don't have a 4.2 compiler built to test yet, but I guess this should
also go on that branch once 4.2.2 is released.

Jon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: missing_policy.diff
Type: text/x-patch
Size: 478 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20070910/824d72ee/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2.cc
Type: text/x-c++src
Size: 1420 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20070910/824d72ee/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2.cc
Type: text/x-c++src
Size: 1452 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20070910/824d72ee/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ChangeLog
Type: application/octet-stream
Size: 341 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20070910/824d72ee/attachment.obj>


More information about the Libstdc++ mailing list