Skip to content

Including Any.h causes Compiler error on Visual Studio #3682

@KevDi

Description

@KevDi

Describe the bug
When i include the Any.h Header in my Project, i'm unable to build it anymore.

This is the error i got (VS142 Platform Toolset VS2019)

C:\Users\djc3ho\Documents\Unterlagen\Projekte\programming\cpp\_libraries\poco\Foundation\include\Poco\Any.h(124,1): fatal error C1001: Internal compiler error.
1>(compiler file 'msc1.cpp', line 1603)
1> To work around this problem, try simplifying or changing the program near the locations listed above.
1>If possible please provide a repro here: https://developercommunity.visualstudio.com
1>Please choose the Technical Support command on the Visual C++
1> Help menu, or open the Technical Support help file for more information
1>C:\Users\djc3ho\Documents\Unterlagen\Projekte\programming\cpp\_libraries\poco\Foundation\include\Poco\Any.h(210): message : see reference to class template instantiation 'Poco::Placeholder<PlaceholderT,SizeV>' being compiled
1>INTERNAL COMPILER ERROR in 'C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\CL.exe'
1>    Please choose the Technical Support command on the Visual C++
1>    Help menu, or open the Technical Support help file for more information

It points to this point in the Any.h:

template<typename T, typename V,
		typename std::enable_if<TypeSizeGT<T, Placeholder::Size::value>::value>::type* = nullptr>
	PlaceholderT* assign(const V& value)
	{
		erase();
		pHolder = new T(value);
		setLocal(false);
		return pHolder;
	}

To Reproduce
Minimal Example:

#include <iostream>
#include <Poco/Any.h>

int main()
{
  std::cout << "Hello World!\n";
  std::string text = "test message";
  Poco::Any value = text;
  std::cout << value.type().name() << '\n';
}

Please add relevant environment information:

  • Windows 10
  • Poco 1.12.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions