Skip to content

Commit e28d8e7

Browse files
authored
Merge branch 'master' into mb-cppcx2
2 parents 0d37ec8 + 1d94917 commit e28d8e7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

docs/cpp-conformance-improvements-2017.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ In Visual Studio 2015, the compiler erroneously treated copy-list-initialization
8787

8888
```cpp
8989
// From http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#1228
90-
struct MyList {
90+
struct MyStore {
9191
explicit MyStore(int initialCapacity);
9292
};
9393

@@ -275,6 +275,15 @@ static_assert(test1, "PASS1");
275275
constexpr bool test2 = !IsCallable<int*, int>::value;
276276
static_assert(test2, "PASS2");
277277
```
278+
### Classes declared in anonymous namespaces
279+
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."
280+
281+
```cpp
282+
namespace
283+
{
284+
struct __declspec(dllexport) S1 { virtual void f() {} }; //C2201
285+
}
286+
```
278287

279288
### Classes declared in anonymous namespaces
280289
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."

0 commit comments

Comments
 (0)