Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
KevDi opened this issue Jul 13, 2022 · 3 comments
Closed

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

KevDi opened this issue Jul 13, 2022 · 3 comments

Comments

@KevDi
Copy link
Contributor

KevDi commented Jul 13, 2022

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
@KevDi KevDi added the bug label Jul 13, 2022
@KevDi
Copy link
Contributor Author

KevDi commented Jul 13, 2022

Ok i was able to solve this by adding POCO_NO_SOO to the Preprocessor Definitions.

@aleks-f
Copy link
Member

aleks-f commented Jul 13, 2022

I can't reproduce this (without POCO_NO_SOO define)

image

@KevDi
Copy link
Contributor Author

KevDi commented Jul 13, 2022

More infos about this issue could be found here: #3683 (comment)

@aleks-f aleks-f added this to the Release 1.12.2 milestone Jul 25, 2022
aleks-f added a commit that referenced this issue Jul 25, 2022
aleks-f added a commit that referenced this issue Jul 26, 2022
* fix(Thread_POSIX): sleep() poor performance #3703

* chore(vscode): add file associations

* fix(TaskManager): waits for all threads in the ThreadPool #3704

* fix(Thread): call std::this_thread::sleep_for() to sleep #3703

* fix(PollSet): wakeup fd is never read #3708

* feat(Thread): Add Thread::set/getAffinity() #3709

* doc(Thread): Thread::trySleep() assertion #3710

* fix(PollSet): wakeup fd is never read (windows portion and some other optimizations) #3708

* feat(SocketReactor): improvements #3713

* chore(ThreadTest): add missing include

* fix(PollSet): wakeup fd is never read #3708

* fix(Any): #3682 #3683 #3692 #3712

* fix(mingw): lowercase winsock2 and iphlpapi to allow cross compile #3711

* feat(Thread): Add Thread::set/getAffinity() #3709

* chore(SocketReactor): one-liners inlined, removed redundant try/catch in dospatch, remove unused onBusy()

* feat(SocketReactor): add socket to ErrorNotification

* fix(SocketReactor): pollTimeout assignment and ConnectorTest leak
@aleks-f aleks-f closed this as completed Aug 7, 2022
aleks-f added a commit that referenced this issue Aug 11, 2022
@aleks-f aleks-f modified the milestones: Release 1.12.2, Release 1.12.3 Oct 6, 2022
@aleks-f aleks-f reopened this Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants