r191095 - Use -fms-compatibility to trigger lookup into dep. bases

Richard Smith richard at metafoo.co.uk
Fri Sep 20 10:12:02 PDT 2013


On Fri, Sep 20, 2013 at 10:04 AM, Reid Kleckner <reid at kleckner.net> wrote:

> Author: rnk
> Date: Fri Sep 20 12:04:25 2013
> New Revision: 191095
>
> URL: http://llvm.org/viewvc/llvm-project?rev=191095&view=rev
> Log:
> Use -fms-compatibility to trigger lookup into dep. bases
>
> Update the docs for -fms-extensions and -fms-compatibility to try to
> clarify the difference between the two.
>
> Modified:
>     cfe/trunk/docs/UsersManual.rst
>     cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp
>     cfe/trunk/test/SemaTemplate/lookup-dependent-bases.cpp
>
> Modified: cfe/trunk/docs/UsersManual.rst
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/UsersManual.rst?rev=191095&r1=191094&r2=191095&view=diff
>
> ==============================================================================
> --- cfe/trunk/docs/UsersManual.rst (original)
> +++ cfe/trunk/docs/UsersManual.rst Fri Sep 20 12:04:25 2013
> @@ -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.
>

We drop MS IDL-style attributes with no warning.

[hello world] struct S {};


>  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
>
> Modified: cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp?rev=191095&r1=191094&r2=191095&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp Fri Sep 20 12:04:25 2013
> @@ -484,7 +484,7 @@ bool Sema::BuildCXXNestedNameSpecifier(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(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);
>
> Modified: cfe/trunk/test/SemaTemplate/lookup-dependent-bases.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/lookup-dependent-bases.cpp?rev=191095&r1=191094&r2=191095&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/SemaTemplate/lookup-dependent-bases.cpp (original)
> +++ cfe/trunk/test/SemaTemplate/lookup-dependent-bases.cpp Fri Sep 20
> 12:04:25 2013
> @@ -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 {
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130920/c9bb271e/attachment.html>


More information about the cfe-commits mailing list