Skip to content

Repo sync for protected CLA branch #4364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 25 additions & 7 deletions docs/build/reference/permissive-standards-conformance.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "/permissive- (Standards conformance)"
description: "Reference guide to the Microsoft C++ /permissive- (Standards conformance) compiler option."
ms.date: 06/29/2022
ms.date: 12/14/2022
f1_keywords: ["/permissive", "VC.Project.VCCLCompilerTool.ConformanceMode"]
helpviewer_keywords: ["/permissive compiler options [C++]", "-permissive compiler options [C++]", "Standards conformance compiler options", "permissive compiler options [C++]"]
ms.assetid: db1cc175-6e93-4a2e-9396-c3725d2d8f71
Expand Down Expand Up @@ -52,27 +52,45 @@ void func(int default); // Error C2321: 'default' is a keyword, and

```cpp
template <typename T>
struct B {
void f();
struct B
{
void f() {}
template <typename U>
struct S { void operator()(){ return; } };
};

template <typename T>
struct D : public B<T> // B is a dependent base because its type
// depends on the type of T.
{
// One possible fix is to uncomment the following line.
// If this is a type, don't forget the 'typename' keyword.
// One possible fix for non-template members and function
// template members is a using statement:
// using B<T>::f;
// If it's a type, don't forget the 'typename' keyword.

void g() {
void g()
{
f(); // error C3861: 'f': identifier not found
// Another fix is to change it to 'this->f();'
// Another fix is to change the call to 'this->f();'
}

void h()
{
S<int> s; // C2065 or C3878
// Since template S is dependent, the type must be qualified
// with the `typename` keyword.
// To fix, replace the declaration of s with:
// typename B<T>::template S<int> s;
// Or, use this:
// typename D::template S<int> s;
s();
}
};

void h() {
D<int> d;
d.g();
d.h();
}
```

Expand Down