llvm-project/clang/test/CXX
Mark de Wever 0ce6d6b46e [Sema] List conversion validate character array.
The function `TryListConversion` didn't properly validate the following
part of the standard:

    Otherwise, if the parameter type is a character array [... ]
    and the initializer list has a single element that is an
    appropriately-typed string literal (8.5.2 [dcl.init.string]), the
    implicit conversion sequence is the identity conversion.

This caused the following call to `f()` to be ambiguous.
    void f(int(&&)[1]);
    void f(unsigned(&&)[1]);

    void g(unsigned i) {
      f({i});
    }

This issue only occurs when the initializer list had one element.

Differential Revision: https://reviews.llvm.org/D87561
2020-10-03 14:33:28 +02:00
..
basic Improve diagnostics for missing import / #include of module. 2020-04-28 18:41:14 -07:00
class Better diagnostics for anonymous bit-fields with attributes or an initializer. 2020-09-29 16:32:20 -04:00
class.access [AST][RecoveryExpr] Build recovery expressions by default for C++. 2020-06-12 15:21:38 +02:00
class.derived Defer checking for mismatches between the deletedness of and overriding 2020-03-12 13:07:22 -07:00
conv [Sema][C++] Propagate conversion kind to specialize the diagnostics 2020-02-25 16:05:37 +00:00
cpp PR41192: fix cases where "missing ';' after class" error would 2019-04-16 00:47:45 +00:00
dcl [Concepts] Deprecate -fconcepts-ts, enable Concepts under -std=c++2a 2020-01-24 00:48:59 +02:00
dcl.dcl Canonicalize declaration pointers when forming APValues. 2020-09-27 19:05:26 -07:00
dcl.decl [clang] Pass the NamedDecl* instead of the DeclarationName into many diagnostics. 2020-07-28 10:30:35 +01:00
drs [Sema] List conversion validate character array. 2020-10-03 14:33:28 +02:00
except [CGCall] Annotate references with "align" attribute. 2020-05-19 20:21:30 -07:00
expr Explain why the array bound is non-constant in VLA diagnostics. 2020-08-19 15:45:51 -07:00
lex [C++20] Implement context-sensitive header-name lexing and pp-import parsing in the preprocessor. 2019-04-11 21:18:23 +00:00
module Improve diagnostics for missing import / #include of module. 2020-04-28 18:41:14 -07:00
modules-ts Improve diagnostics for missing import / #include of module. 2020-04-28 18:41:14 -07:00
over [c++20] Further extend the set of comparisons broken by C++20 that we 2020-03-20 14:22:48 -07:00
special [AST][RecoveryExpr] Build recovery expressions by default for C++. 2020-06-12 15:21:38 +02:00
stmt.stmt [clang] Pass the NamedDecl* instead of the DeclarationName into many diagnostics. 2020-07-28 10:30:35 +01:00
temp [c++20] Consistent with the intent to allow all plausible types in 2020-09-20 23:09:26 -07:00