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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to