[LLVMbugs] [Bug 21367] New: Extension to support rvalue references causes some legal C++03 to fail compile

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Oct 24 01:14:42 PDT 2014


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

            Bug ID: 21367
           Summary: Extension to support rvalue references causes some
                    legal C++03 to fail compile
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: myriachan at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following (as far as I know) legal C++03 code does not compile in
-std=c++03 mode, because clang automatically invokes the rvalue reference
extension.

#include <cstdio>

struct T
{
    operator T() const { return *this; }
    T operator +() const { return *this; }
};

void operator &&(T (T::*)() const, T)
{
    std::printf("operator && called\n");
}

int main(int, const char *const *)
{
    &T::operator T && +T();
    return 0;
}

-- 
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/20141024/7cde45a5/attachment.html>


More information about the llvm-bugs mailing list