Skip to content

Commit 65eb223

Browse files
authored
Update cpp-conformance-improvements-2017.md
fixed example for new entry per tech review
1 parent 138c71e commit 65eb223

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

docs/cpp-conformance-improvements-2017.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,10 @@ static_assert(test2, "PASS2");
279279
According to the C++ standard, a class declared inside an anonymous namespace has internal linkage, and therefore cannot be exported. In Visual Studio 2015 and earlier, this rule was not enforced. In Visual Studio 2017 the rule is partially enforced. The following example raises this error in Visual Studio 2017: "error C2201: 'const `anonymous namespace'::S1::`vftable'': must have external linkage in order to be exported/imported."
280280

281281
```cpp
282-
struct __declspec(dllexport) S1 { virtual void f() {} }; //C2201
282+
namespace
283+
{
284+
struct __declspec(dllexport) S1 { virtual void f() {} }; //C2201
285+
}
283286
```
284287

285288
### Default initializers for value class members (C++/CLI)

0 commit comments

Comments
 (0)