<p>Sure, r151776. dgregor said "-ms-extensions" on the bug, but I see now that that predates the existence of -fms-compatibility.</p><p>Nico</p>
<div class="gmail_quote">On Feb 29, 2012 3:05 PM, "Eli Friedman" <<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

On Wed, Feb 29, 2012 at 2:54 PM, Nico Weber <<a href="mailto:nicolasweber@gmx.de" target="_blank">nicolasweber@gmx.de</a>> wrote:<br>
> Author: nico<br>
> Date: Wed Feb 29 16:54:43 2012<br>
> New Revision: 151768<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=151768&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=151768&view=rev</a><br>
> Log:<br>
> Allow operator keywords to be #defined in ms-ext mode.<br>
><br>
> Fixes PR10606.<br>
><br>
> I'm not sure if this is the best way to go about it, but<br>
> I locally enabled this code path without the msext conditional,<br>
> and all tests pass, except for test/Preprocessor/cxx_oper_keyword.cpp<br>
> which explicitly checks that operator keywords can't be redefined.<br>
><br>
> I also parsed chromium/win with a clang with and without this patch.<br>
> It introduced no new errors, but removes 43 existing errors.<br>
><br>
><br>
><br>
> Added:<br>
>    cfe/trunk/test/Preprocessor/cxx_oper_keyword_ms_ext.cpp<br>
> Modified:<br>
>    cfe/trunk/include/clang/Lex/Preprocessor.h<br>
>    cfe/trunk/lib/Lex/PPDirectives.cpp<br>
><br>
> Modified: cfe/trunk/include/clang/Lex/Preprocessor.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Preprocessor.h?rev=151768&r1=151767&r2=151768&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Preprocessor.h?rev=151768&r1=151767&r2=151768&view=diff</a><br>


> ==============================================================================<br>
> --- cfe/trunk/include/clang/Lex/Preprocessor.h (original)<br>
> +++ cfe/trunk/include/clang/Lex/Preprocessor.h Wed Feb 29 16:54:43 2012<br>
> @@ -815,8 +815,8 @@<br>
>   /// SmallVector. Note that the returned StringRef may not point to the<br>
>   /// supplied buffer if a copy can be avoided.<br>
>   StringRef getSpelling(const Token &Tok,<br>
> -                              SmallVectorImpl<char> &Buffer,<br>
> -                              bool *Invalid = 0) const;<br>
> +                        SmallVectorImpl<char> &Buffer,<br>
> +                        bool *Invalid = 0) const;<br>
><br>
>   /// getSpellingOfSingleCharacterNumericConstant - Tok is a numeric constant<br>
>   /// with length 1, return the character.<br>
><br>
> Modified: cfe/trunk/lib/Lex/PPDirectives.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPDirectives.cpp?rev=151768&r1=151767&r2=151768&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPDirectives.cpp?rev=151768&r1=151767&r2=151768&view=diff</a><br>


> ==============================================================================<br>
> --- cfe/trunk/lib/Lex/PPDirectives.cpp (original)<br>
> +++ cfe/trunk/lib/Lex/PPDirectives.cpp Wed Feb 29 16:54:43 2012<br>
> @@ -120,8 +120,15 @@<br>
>     std::string Spelling = getSpelling(MacroNameTok, &Invalid);<br>
>     if (Invalid)<br>
>       return;<br>
> -<br>
> +<br>
>     const IdentifierInfo &Info = Identifiers.get(Spelling);<br>
> +<br>
> +    // Allow #defining |and| and friends in microsoft mode.<br>
> +    if (Info.isCPlusPlusOperatorKeyword() && getLangOptions().MicrosoftExt) {<br>
<br>
Please put this under MicrosoftMode.<br>
<br>
-Eli<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>