X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=gcc%2Ftestsuite%2Fg%2B%2B.old-deja%2Fg%2B%2B.jason%2Frvalue1.C;fp=gcc%2Ftestsuite%2Fg%2B%2B.old-deja%2Fg%2B%2B.jason%2Frvalue1.C;h=0000000000000000000000000000000000000000;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=01cd497b1c07143276dbecd5912d70ef0826d4e2;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/gcc/testsuite/g++.old-deja/g++.jason/rvalue1.C b/gcc/testsuite/g++.old-deja/g++.jason/rvalue1.C deleted file mode 100644 index 01cd497b..00000000 --- a/gcc/testsuite/g++.old-deja/g++.jason/rvalue1.C +++ /dev/null @@ -1,51 +0,0 @@ -// PRMS Id: 6000 -// Bug: g++ gets confused trying to build up a reference to a cast. - -class String { -protected: - char *cp; -public: - String(char *incp); - String(const String &constStringRef); - virtual void virtualFn1(void) const {;} -}; - -String::String(char *incp) -{ - cp = incp; -} - -String::String(const String &constStringRef) -{ -// Right here, do an 'info args', and look at the virtual function table -// pointer: typically junk! Calling the function through that table could -// do anything, since we're really leaping off into the void. This example -// goes down with 'SIGBUS', but I've seen 'SIGSEGV' too, and 'SIGILL' is -// possible. - - cp = constStringRef.cp; - constStringRef.virtualFn1(); -} - -void foofun(String string) -{ - ; -} - -class Class1 { -public: - Class1(const String & constStringRef); -}; - -Class1 :: Class1 (const String & constStringRef) -{ -// If instead of calling the function 'foofun()' here, we just assign -// 'constStringRef' to a local variable, then the vptr is typically == 0! - - foofun(String(constStringRef)); -} - -int main(void) -{ - Class1 *class1 = new Class1("Hi!"); -}