[LLVMbugs] [Bug 18876] New: is_default_constructible and DRs 1354, 1424

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Feb 17 18:35:16 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=18876

            Bug ID: 18876
           Summary: is_default_constructible and DRs 1354, 1424
           Product: clang
           Version: 3.4
          Hardware: Other
                OS: Linux
            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

The implementation of is_default_constructible in libstdc++ is based on the
validity of a decltype-specifier whose expression is a function-style cast for
the type being queried with no arguments.

Using that implementation, Clang 3.4 (tags/RELEASE_34/final) does not produce
the expected result for struct A below. It seems that one or both of DR 1354
and 1424 is not yet implemented by Clang.

SOURCE:
struct A { ~A() = delete; };

template <typename T> struct TypeSink;
TypeSink<decltype(A())> *typeSink;

/*
#include <type_traits>

extern char x[std::is_default_constructible<A>::value ? 42 : -1];
extern char x[42];
*/

EXPECTED OUTPUT:
(errors)

ACTUAL OUTPUT:
(successful compile)

-- 
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/20140218/9db198ee/attachment.html>


More information about the llvm-bugs mailing list