Opened 13 years ago

Closed 12 years ago

#4108 closed Bugs (fixed)

C2139 error in VS2010

Reported by: ka3a4ok@… Owned by: Peter Dimov
Milestone: Boost 1.43.0 Component: smart_ptr
Version: Boost 1.42.0 Severity: Problem
Keywords: C2139 2139 VS2010 Cc:

Description

VC2008 can compile this code, but VS2010 can't. Error log attached.

#include <boost/variant.hpp>
#include <boost/shared_ptr.hpp>

struct NonTerminal;
struct Terminal;

typedef boost::variant
<	boost::recursive_wrapper<NonTerminal>,
	Terminal
> AST;

struct NonTerminal
{
public:
	NonTerminal(boost::shared_ptr<AST> a):
	  m(a)
	{

	}

	boost::shared_ptr<AST> m;
};

struct Terminal
{

};

void main()
{

}

Attachments (1)

errors.txt (1.3 KB ) - added by ka3a4ok@… 13 years ago.
Error log from compiler

Download all attachments as: .zip

Change History (4)

by ka3a4ok@…, 13 years ago

Attachment: errors.txt added

Error log from compiler

comment:1 by Steven Watanabe, 13 years ago

Component: Nonesmart_ptr
Owner: set to Peter Dimov

This is caused by some unintended ADL in shared_ptr.

comment:2 by Steven Watanabe, 13 years ago

(In [61344]) Work around over-eager ADL with msvc-10.0. Refs #4108

comment:3 by Peter Dimov, 12 years ago

Resolution: fixed
Status: newclosed

(In [62244]) Merge [61344] to release. Fixes #4108.

Note: See TracTickets for help on using tickets.