C++ (Qt)void Test( const QWidget & w ){} int main( int argc, char *argv[] ) { Test(QPushButton("btn")); return 0;}
C++ (Qt)void Test( const QString & txt ); // 1QString txt("abc");Test(txt); // 2Test("abc");
main.cpp:9:7: warning: C++98 requires an accessible copy constructor for class 'QPushButton' when binding a reference to a temporary; was private [-Wbind-to-temporary-copy] Test(QPushButton("btn"));
C++ (Qt)MyClass GetA( void );..MyClass a = GetA();