https://bugs.llvm.org/show_bug.cgi?id=49808
Bug ID: 49808
Summary: Incorrect partial specialization selected for
zero-length-array type
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangb...@nondot.org
Reporter: matthewjbariche...@gmail.com
CC: blitzrak...@gmail.com, dgre...@apple.com,
erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
richard-l...@metafoo.co.uk
Affected versions:
- trunk
- 11.0.1
- 11.0.0
- 10.0.1
- 10.0.0
- 9.0.1
- 9.0.0
- 8.0.1
- 8.0.0
- 7.1.0
- 7.0.1
- 7.0.0
- 6.0.1
- 6.0.0
- 5.0.1
- 5.0.0
- 4.0.1
- 4.0.0
Driver cmdline:
Note: For clang 4.0.1 and 4.0.0, '-std=c++1z' was substituted for '-std=c++17'
clang++ -std=c++17
Code:
#include<type_traits>
tempalte<typename>
struct A : std::false_type {};
template<typename T, auto N>
struct A<T[N]> : std::true_type {};
static_assert(A<int[0]>::value);
Expected behaviour:
The static assertion passes; the 'A<T[N]>' partial specialization should've
been selected.
Actual behaviour:
The static assertion fails; the base template is selected
Notes:
Even when adding the following partial specialization, the base template is
still, incorrectly, selected:
template<typename T>
struct A<T[0]> : std::true_type {};
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs