[LLVMbugs] [Bug 21502] New: __has_feature(cxx_reference_qualified_functions) should be checked when defining LLVM_HAS_RVALUE_REFERENCE_THIS

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Nov 6 09:53:45 PST 2014


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

            Bug ID: 21502
           Summary: __has_feature(cxx_reference_qualified_functions)
                    should be checked when defining
                    LLVM_HAS_RVALUE_REFERENCE_THIS
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: igor.bronstein at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

LLVM_HAS_RVALUE_REFERENCE_THIS macro is defined int Compiler.h:
http://llvm.org/docs/doxygen/html/Compiler_8h.html#a563b0d795936bbc69d7a40c6791c5827

in the way as follows:
00080 #if __has_feature(cxx_rvalue_references) || LLVM_GNUC_PREREQ(4, 8, 1)
00081 #define LLVM_HAS_RVALUE_REFERENCE_THIS 1
00082 #else
00083 #define LLVM_HAS_RVALUE_REFERENCE_THIS 0
00084 #endif

Shouldn't its definition look like:

00080 #if __has_feature(cxx_reference_qualified_functions) ||
LLVM_GNUC_PREREQ(4, 8, 1)
00081 #define LLVM_HAS_RVALUE_REFERENCE_THIS 1
00082 #else
00083 #define LLVM_HAS_RVALUE_REFERENCE_THIS 0
00084 #endif

instead? __has_feature(cxx_reference_qualified_functions) checks whether Clang
support "Extending move semantics to *this" C+11 feature:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm

and that's exactly what the LLVM_HAS_RVALUE_REFERENCE_THIS is intended for.

-- 
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/20141106/c750ef5d/attachment.html>


More information about the llvm-bugs mailing list