[llvm-bugs] [Bug 44449] New: Implicit conversion error, adding qualifiers (non-const to const), with reference to array.
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Jan 3 00:54:38 PST 2020
https://bugs.llvm.org/show_bug.cgi?id=44449
Bug ID: 44449
Summary: Implicit conversion error, adding qualifiers
(non-const to const), with reference to array.
Product: clang
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: choon-ho.choe at vitrox.com
CC: blitzrakete at gmail.com, dgregor at apple.com,
erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
richard-llvm at metafoo.co.uk
As title, refer to example, https://godbolt.org/z/yFx-Zz
/////////////////////////////////
#include <type_traits>
void f(const void* const (*)[1]);
void g(const void* const (&)[1]);
void test()
{
static_assert(std::is_convertible<void* (*)[], const void* const
(*)[]>::value, ""); // fails in msvc.
static_assert(std::is_convertible<void* (&)[], const void* const
(&)[]>::value, ""); // fails in msvc, clang.
void* x[1];
f(&x); // fails in msvc.
g( x); // fails in msvc, clang.
}
/////////////////////////////////
MSVC aside, GCC (trunk) passes both cases, Clang rejects the reference case.
I find this inconsistency weird, could this be a potential bug or the language
left it unspecified.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200103/cb56e1ad/attachment.html>
More information about the llvm-bugs
mailing list