[LLVMbugs] [Bug 20706] New: Cv-qualification mismatch in dependent pseudo-destructor call fails to reject candidate
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Aug 19 19:42:16 PDT 2014
http://llvm.org/bugs/show_bug.cgi?id=20706
Bug ID: 20706
Summary: Cv-qualification mismatch in dependent
pseudo-destructor call fails to reject candidate
Product: clang
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: hstong at ca.ibm.com
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
Cv-qualification mismatch on a pseudo-destructor call can appear in a SFINAE
context.
Notwithstanding Core Issue 1920, which does not have a proposed resolution as
of R90 of the issues list, the test case below should pass.
### SOURCE:
$ cat sfinaeStrictlyNo1920.cc
template <typename T, typename U = void>
struct A { typedef T ty; };
template <unsigned> struct NumSink { typedef void ty; };
typedef const int ConstInt;
template <typename T>
struct A<T, typename NumSink<sizeof (0 .ConstInt::~T(), 0)>::ty>
{ enum { val = 0 }; };
typedef A<int>::ty ty;
### COMPILER INVOCATION AND OUTPUT:
$ clang -cc1 -x c++ -std=c++03 sfinaeStrictlyNo1920.cc
sfinaeStrictlyNo1920.cc:12:9: error: no type named 'ty' in 'A<int, void>'; did
you mean 'NumSink<4>::ty'?
typedef A<int>::ty ty;
^~~~~~~~~~
NumSink<4>::ty
sfinaeStrictlyNo1920.cc:4:51: note: 'NumSink<4>::ty' declared here
template <unsigned> struct NumSink { typedef void ty; };
^
1 error generated.
### EXPECTED BEHAVIOUR:
Clean compile.
### COMPILER VERSION INFO:
$ clang -v
clang version 3.6.0 (trunk 215824)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Selected multilib: .;@m64
--
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/20140820/8b177146/attachment.html>
More information about the llvm-bugs
mailing list