[patch] missing template argument in __weak_ptr::lock

Benjamin Kosnik bkoz@redhat.com
Thu Sep 13 23:22:00 GMT 2007


> __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

Bummer.

I can reproduce this.
 
> 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?

Yes, and 4_2-branch.

> 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.

Indeed.

best,
benjamin



More information about the Libstdc++ mailing list