[LLVMdev] Compiling LLVM 2.7 with Visual Studio 2010.

Tom van Dijck llvm at tomvandijck.com
Sat May 1 22:09:23 PDT 2010


On Sat, May 1, 2010 at 10:02 PM, me22 <me22.ca at gmail.com> wrote:

> On 2 May 2010 00:53, Tom van Dijck <llvm at tomvandijck.com> wrote:
> > The problem seems to be a much larger issue with the Visual Studio 2010
> C++
> > Compiler and not really related to clang/llvm. The following snippet of
> code
> > does NOT compile in 2010..
> >
> > #include <vector>
> > int main(int argc, char* argv[])
> > {
> >     std::pair<int, void*> mypair(0, NULL);
> >     return 0;
> > }
> >
>
> That's perfectly fine -- it never #includes <utility>,
> so there's no reason for std::pair to be in scope.
>

#include <vector>
int main(int argc, char* argv[])
{
    std::pair<int, void*> mypair(0, (void*)NULL);
    return 0;
}

compiles fine though...
couple people have reported the same issue actually, and apparently this is
by design due to C++0x:

https://connect.microsoft.com/VisualStudio/feedback/details/520043/error-converting-from-null-to-a-pointer-type-in-std-pair?wa=wsignin1.0#tabs

Tom.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100501/9d3c0d3f/attachment.html>


More information about the llvm-dev mailing list