diff options
author | Jeffrey Yasskin <jyasskin@google.com> | 2011-08-12 20:56:43 +0000 |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@google.com> | 2011-08-12 20:56:43 +0000 |
commit | 6d0ee8d77b6d37fa0dec1d55aa13429a6608e7a9 (patch) | |
tree | 50fd1d447fbf2b14a4dcc63066942e391bad55fa /lib/Sema/SemaInit.cpp | |
parent | 3a02b44e3948f7762dbfba94b7961281ca29d022 (diff) |
Conversions to bool count as integer conversions for the purposes of
the C++0x narrowing error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137512 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r-- | lib/Sema/SemaInit.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index c406ad9840..e410f2f9a0 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -2321,6 +2321,7 @@ bool InitializationSequence::endsWithNarrowing(ASTContext &Ctx, // the source is a constant expression and the actual value after // conversion will fit into the target type and will produce the original // value when converted back to the original type. + case ICK_Boolean_Conversion: // Bools are integers too. case ICK_Integral_Conversion: { assert(FromType->isIntegralOrUnscopedEnumerationType()); assert(ToType->isIntegralOrUnscopedEnumerationType()); |