Public bug reported:

Next simple "Hello world" :

#include <iostream>

using namespace std;

class X
{
public:
    X (const X& lvalue)
    {
      cout << "Copy constructor" << endl;
    }
    
    X (X&& rvalue)
    {
      cout << "Move constructor" << endl;
    }
    
};

int main(int argc, char **argv) {
    cout << "Hello, world!" << endl;
        return 0;
}


produce next error:
SimpleTest/main.cpp:13:9: error: expected ‘,’ or ‘...’ before ‘&&’ token
     X (X&& rvalue)
         ^
SimpleTest/main.cpp:13:18: error: invalid constructor; you probably meant ‘X 
(const X&)’
     X (X&& rvalue)


clang version 3.5.0-4ubuntu2    build  above code without errors.

ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: g++ 4:4.9.1-4ubuntu2
ProcVersionSignature: Ubuntu 3.16.0-25.33-generic 3.16.7
Uname: Linux 3.16.0-25-generic x86_64
ApportVersion: 2.14.7-0ubuntu8
Architecture: amd64
CurrentDesktop: LXDE
Date: Tue Nov 25 21:42:54 2014
InstallationDate: Installed on 2014-10-25 (31 days ago)
InstallationMedia: Lubuntu 14.10 "Utopic Unicorn" - Release amd64 (20141022.1)
SourcePackage: gcc-defaults
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: gcc-defaults (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug utopic

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1396329

Title:
  Rvalue reference error

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1396329/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to