llvm-project/clang/test/CXX
Mikhail Maltsev 7b1a950c4a [Sema] Classify conversions from enum to float as narrowing
Summary:
According to [dcl.init.list]p7:
  A narrowing conversion is an implicit conversion
  - ...
  - from an integer type or unscoped enumeration type to a
    floating-point type, except where 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, or
  - ...

Currently clang does not handle the 'unscoped enumeration' case. This
patch fixes the corresponding check.

Reviewers: faisalv, rsmith, rogfer01

Reviewed By: rogfer01

Subscribers: rogfer01, cfe-commits

Differential Revision: https://reviews.llvm.org/D42545

llvm-svn: 325668
2018-02-21 10:08:18 +00:00
..
basic
class
class.access
class.derived
concepts-ts Remove old concepts parsing code 2017-12-07 00:34:20 +00:00
conv
cpp/cpp.predefined
dcl.dcl [Sema] Fix decltype of static data members 2018-02-14 11:34:25 +00:00
dcl.decl [Sema] Classify conversions from enum to float as narrowing 2018-02-21 10:08:18 +00:00
drs Fix test failure on target where size_t is long long. 2018-02-19 22:50:50 +00:00
except
expr P0620 follow-up: deducing `auto` from braced-init-list in new expr 2017-12-11 18:29:54 +00:00
lex
modules-ts
over [Sema] Improve diagnostics for const- and ref-qualified member functions 2017-12-31 18:27:29 +00:00
special
stmt.stmt [Sema] Improve diagnostics for const- and ref-qualified member functions 2017-12-31 18:27:29 +00:00
temp [Parser][FixIt] Better diagnostics for "typedef" instead of "typename" typo 2018-02-08 14:37:58 +00:00