For builds using ICC, a part of export symbols can be lost:
while there is no such troubles for builds using MSVC:
not reproduced for:
Wherein a content of precompiled headers, used for that builds, has no effect on this issue. I.e., the same error reproduced even if '.h' file, used to produce '.pch' file, contain a space symbol only.
As another possible ICC issue, related to PCH use, can be considered precompilation of testcase from Description using ICC and MSVC:
icl -c -Yc -Fptest_icc_pch.pch -Fotest_icc_pch.obj -Tp test.cpp Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.104.22.168 Build 20171018 Copyright (C) 1985-2017 Intel Corporation. All rights reserved. test.cpp test.cpp(2): warning #2728: could not create precompiled header file struct __declspec(dllexport) SelectionContext ^ <snip> cl -c -Yc -Fptest_msvc_pch.pch -Fotest_msvc_pch.obj -Tp test.cpp Microsoft (R) C/C++ Optimizing Compiler Version 19.12.25830.2 for x64 Copyright (C) Microsoft Corporation. All rights reserved. test.cpp <snip> dir /B test* test.cpp test_icc_pch.obj test_msvc_pch.obj test_msvc_pch.pch
Found no evidence, that it occur during build of notable OSS projects. But still odd, that ICC failed to produce '.pchi' file from test case, while MSVC built it successfully.
What about error, mentioned in Post #2? Is it expected behavior, or it was registered in that ticket too?
Concerning post #2, the command line option Fpfoo.pch requests that the precompiled header file be created in a file suffixed with .pch, but Intel precompiled header files have a different format than the Microsoft precompiled header files. Microsoft names their files .pch and Intel uses .pchi to avoid confusion and error.