[cfe-commits] r151768 - in /cfe/trunk: include/clang/Lex/Preprocessor.h lib/Lex/PPDirectives.cpp test/Preprocessor/cxx_oper_keyword_ms_ext.cpp

Nico Weber thakis at chromium.org
Wed Feb 29 16:19:07 PST 2012


Sure, r151776. dgregor said "-ms-extensions" on the bug, but I see now that
that predates the existence of -fms-compatibility.

Nico
On Feb 29, 2012 3:05 PM, "Eli Friedman" <eli.friedman at gmail.com> wrote:

> On Wed, Feb 29, 2012 at 2:54 PM, Nico Weber <nicolasweber at gmx.de> wrote:
> > Author: nico
> > Date: Wed Feb 29 16:54:43 2012
> > New Revision: 151768
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=151768&view=rev
> > Log:
> > Allow operator keywords to be #defined in ms-ext mode.
> >
> > Fixes PR10606.
> >
> > I'm not sure if this is the best way to go about it, but
> > I locally enabled this code path without the msext conditional,
> > and all tests pass, except for test/Preprocessor/cxx_oper_keyword.cpp
> > which explicitly checks that operator keywords can't be redefined.
> >
> > I also parsed chromium/win with a clang with and without this patch.
> > It introduced no new errors, but removes 43 existing errors.
> >
> >
> >
> > Added:
> >    cfe/trunk/test/Preprocessor/cxx_oper_keyword_ms_ext.cpp
> > Modified:
> >    cfe/trunk/include/clang/Lex/Preprocessor.h
> >    cfe/trunk/lib/Lex/PPDirectives.cpp
> >
> > Modified: cfe/trunk/include/clang/Lex/Preprocessor.h
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Preprocessor.h?rev=151768&r1=151767&r2=151768&view=diff
> >
> ==============================================================================
> > --- cfe/trunk/include/clang/Lex/Preprocessor.h (original)
> > +++ cfe/trunk/include/clang/Lex/Preprocessor.h Wed Feb 29 16:54:43 2012
> > @@ -815,8 +815,8 @@
> >   /// SmallVector. Note that the returned StringRef may not point to the
> >   /// supplied buffer if a copy can be avoided.
> >   StringRef getSpelling(const Token &Tok,
> > -                              SmallVectorImpl<char> &Buffer,
> > -                              bool *Invalid = 0) const;
> > +                        SmallVectorImpl<char> &Buffer,
> > +                        bool *Invalid = 0) const;
> >
> >   /// getSpellingOfSingleCharacterNumericConstant - Tok is a numeric
> constant
> >   /// with length 1, return the character.
> >
> > Modified: cfe/trunk/lib/Lex/PPDirectives.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPDirectives.cpp?rev=151768&r1=151767&r2=151768&view=diff
> >
> ==============================================================================
> > --- cfe/trunk/lib/Lex/PPDirectives.cpp (original)
> > +++ cfe/trunk/lib/Lex/PPDirectives.cpp Wed Feb 29 16:54:43 2012
> > @@ -120,8 +120,15 @@
> >     std::string Spelling = getSpelling(MacroNameTok, &Invalid);
> >     if (Invalid)
> >       return;
> > -
> > +
> >     const IdentifierInfo &Info = Identifiers.get(Spelling);
> > +
> > +    // Allow #defining |and| and friends in microsoft mode.
> > +    if (Info.isCPlusPlusOperatorKeyword() &&
> getLangOptions().MicrosoftExt) {
>
> Please put this under MicrosoftMode.
>
> -Eli
>
> _______________________________________________
> 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/20120229/fd5675b8/attachment.html>


More information about the cfe-commits mailing list