Skip to content

Commit 2752fe0

Browse files
author
mikeblome
committed
updated conformance topic per product team
1 parent 3ce5428 commit 2752fe0

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

docs/cpp-conformance-improvements-2017.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,13 @@ constexpr bool test2 = !IsCallable<int*, int>::value;
276276
static_assert(test2, "PASS2");
277277
```
278278

279+
### Classes declared in anonymous namespaces
280+
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."
281+
282+
```cpp
283+
struct __declspec(dllexport) S1 { virtual void f() {} }; //C2201
284+
```
285+
279286
### Default initializers for value class members (C++/CLI)
280287
In Visual Studio 2015 and earlier, the compiler permitted (but ignored) a default member initializer for a member of a value class. Default initialization of a value class always zero-initializes the members; a default constructor is not permitted. In Visual Studio 2017, default member initializers raise a compiler error, as shown in this example:
281288

0 commit comments

Comments
 (0)