On Wed, Feb 20, 2013 at 6:32 PM, NAKAMURA Takumi <[email protected]>wrote:

> Author: chapuni
> Date: Wed Feb 20 20:32:34 2013
> New Revision: 175711
>
> URL: http://llvm.org/viewvc/llvm-project?rev=175711&view=rev
> Log:
> CIndex.cpp: Appease g++-4.4. "if (Optional<unsigned> Minor =
> In.getMinor())" did not work as expected.
>

Thanks for the fix - could you explain how it broke? (I looked at a few bot
logs but couldn't quite figure it out)

Would be useful to know because there's many other examples of similar code
(declaring Optionals in if conditions)


>
> Modified:
>     cfe/trunk/tools/libclang/CIndex.cpp
>
> Modified: cfe/trunk/tools/libclang/CIndex.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=175711&r1=175710&r2=175711&view=diff
>
> ==============================================================================
> --- cfe/trunk/tools/libclang/CIndex.cpp (original)
> +++ cfe/trunk/tools/libclang/CIndex.cpp Wed Feb 20 20:32:34 2013
> @@ -5741,12 +5741,14 @@ static CXVersion convertVersion(VersionT
>
>    Out.Major = In.getMajor();
>
> -  if (Optional<unsigned> Minor = In.getMinor())
> +  Optional<unsigned> Minor = In.getMinor();
> +  if (Minor.hasValue())
>      Out.Minor = *Minor;
>    else
>      return Out;
>
> -  if (Optional<unsigned> Subminor = In.getSubminor())
> +  Optional<unsigned> Subminor = In.getSubminor();
> +  if (Subminor.hasValue())
>      Out.Subminor = *Subminor;
>
>    return Out;
>
>
> _______________________________________________
> cfe-commits mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to