r175711 - CIndex.cpp: Appease g++-4.4. "if (Optional<unsigned> Minor = In.getMinor())" did not work as expected.
Jordan Rose
jordan_rose at apple.com
Wed Feb 20 18:39:47 PST 2013
Interesting. Is this only for Optional with integer types or for all uses of Optional in if-statements? Cause the latter is problematic.
Jordan
On Feb 20, 2013, at 18:32 , NAKAMURA Takumi <geek4civic at gmail.com> 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.
>
> 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
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list