Introducing typo correction candidates causes a warning with -fms-compatibility to become an error.
consider:
$ cat t.cpp
#ifdef BUG
namespace type_in_base_of_dependent_base {
struct A { typedef int NameFromBase; };
}
#endif
namespace function_template_deduction {
// Overloaded function templates.
template <int N> int f() { return N; }
template <typename T> int f() { return sizeof(T); }
// Dependent base class with enum.
template <typename T> struct A { enum { NameFromBase = 4 }; };
template <typename T> struct D : A<T> {
// expected-warning@+1 {{use of undeclared identifier 'NameFromBase'; unqualified lookup into dependent bases}}
int x = f<NameFromBase>();
};
}
$ clang -c t.cpp
t.cpp:16:13: warning: use of undeclared identifier 'NameFromBase'; unqualified lookup into dependent bases of class template 'D' is a Microsoft extension [-Wmicrosoft]
int x = f<NameFromBase>();
^
this->
1 warning generated.
$ clang -c t.cpp -DBUG
t.cpp:16:13: error: unknown type name 'NameFromBase'; did you mean 'type_in_base_of_dependent_base::A::NameFromBase'?
int x = f<NameFromBase>();
^~~~~~~~~~~~
type_in_base_of_dependent_base::A::NameFromBase
t.cpp:3:24: note: 'type_in_base_of_dependent_base::A::NameFromBase' declared here
struct A { typedef int NameFromBase; };
^
1 error generated.
Extended Description
Introducing typo correction candidates causes a warning with
-fms-compatibility
to become an error.consider: