Skip to content

Commit

Permalink
Merge branch 'master' into mb-cppcx2
Browse files Browse the repository at this point in the history
  • Loading branch information
ghogen authored Mar 21, 2017
2 parents 0d37ec8 + 1d94917 commit e28d8e7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion docs/cpp-conformance-improvements-2017.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ In Visual Studio 2015, the compiler erroneously treated copy-list-initialization

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

Expand Down Expand Up @@ -275,6 +275,15 @@ static_assert(test1, "PASS1");
constexpr bool test2 = !IsCallable<int*, int>::value;
static_assert(test2, "PASS2");
```
### Classes declared in anonymous namespaces
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."

```cpp
namespace
{
struct __declspec(dllexport) S1 { virtual void f() {} }; //C2201
}
```

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

0 comments on commit e28d8e7

Please sign in to comment.