]> granicus.if.org Git - clang/commitdiff
Use -fms-compatibility to trigger lookup into dep. bases
authorReid Kleckner <reid@kleckner.net>
Fri, 20 Sep 2013 17:04:25 +0000 (17:04 +0000)
committerReid Kleckner <reid@kleckner.net>
Fri, 20 Sep 2013 17:04:25 +0000 (17:04 +0000)
Update the docs for -fms-extensions and -fms-compatibility to try to
clarify the difference between the two.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191095 91177308-0d34-0410-b5e6-96231b3b80d8

docs/UsersManual.rst
lib/Sema/SemaCXXScopeSpec.cpp
test/SemaTemplate/lookup-dependent-bases.cpp

index 05d8f2715f0090ae58e160d7fb241a28c9bfe66c..15bac1e3e76b690adec88953aaa6a2c52a27bca4 100644 (file)
@@ -1216,12 +1216,15 @@ Microsoft extensions
 clang has some experimental support for extensions from Microsoft Visual
 C++; to enable it, use the -fms-extensions command-line option. This is
 the default for Windows targets. Note that the support is incomplete;
-enabling Microsoft extensions will silently drop certain constructs
-(including ``__declspec`` and Microsoft-style asm statements).
+some constructs like dllexport on classes with inline methods will be
+ignored with a warning.
 
 clang has a -fms-compatibility flag that makes clang accept enough
-invalid C++ to be able to parse most Microsoft headers. This flag is
-enabled by default for Windows targets.
+invalid C++ to be able to parse most Microsoft headers. For example, it
+allows `unqualified lookup of dependent base class members
+<http://clang.llvm.org/compatibility.html#dep_lookup_bases>`, which is a
+common compatibility issue with clang. This flag is enabled by default
+for Windows targets.
 
 -fdelayed-template-parsing lets clang delay all template instantiation
 until the end of a translation unit. This flag is enabled by default for
index f79ad2cc8c7e42a15987db821611ce3acbfca0b5..674411ec06224f880a7fc8e6a87926910343be1b 100644 (file)
@@ -484,7 +484,7 @@ bool Sema::BuildCXXNestedNameSpecifier(Scope *S,
   
   // FIXME: Deal with ambiguities cleanly.
 
-  if (Found.empty() && !ErrorRecoveryLookup && !getLangOpts().MicrosoftExt) {
+  if (Found.empty() && !ErrorRecoveryLookup && !getLangOpts().MicrosoftMode) {
     // We haven't found anything, and we're not recovering from a
     // different kind of error, so look for typos.
     DeclarationName Name = Found.getLookupName();
@@ -644,7 +644,7 @@ bool Sema::BuildCXXNestedNameSpecifier(Scope *S,
   // public:
   //   void foo() { D::foo2(); }
   // };
-  if (getLangOpts().MicrosoftExt) {
+  if (getLangOpts().MicrosoftMode) {
     DeclContext *DC = LookupCtx ? LookupCtx : CurContext;
     if (DC->isDependentContext() && DC->isFunctionOrMethod()) {
       SS.Extend(Context, &Identifier, IdentifierLoc, CCLoc);
index 4fcfbd196407158c2e1c0bcaceb4167e55354b8e..61fca4a2a45f84d30f99bd27473d982b3b7cd59e 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fms-extensions -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fms-compatibility -fsyntax-only -verify %s
 // expected-no-diagnostics
 
 class C {