Return by value to coax Clang into emitting the full definition of a test type.
authorDavid Blaikie <dblaikie@gmail.com>
Sun, 13 Apr 2014 07:48:45 +0000 (00:48 -0700)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 25 Apr 2014 05:15:40 +0000 (22:15 -0700)
gdb/testsuite/
* gdb.cp/pr10728-x.cc: Return by value instead of pointer to coax
Clang into emitting the definition of the type.
* gdb.cp/pr10728-x.h: Ditto.
* gdb.cp/pr10728-y.cc: Ditto.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.cp/pr10728-x.cc
gdb/testsuite/gdb.cp/pr10728-x.h
gdb/testsuite/gdb.cp/pr10728-y.cc

index 25bbc6a6849b6d03a71099afe4634f39445b1174..92a7eee418d724f00ba6e82d3b9103359b26f148 100644 (file)
@@ -1,3 +1,10 @@
+2014-04-24  David Blaikie  <dblaikie@gmail.com>
+
+       * gdb.cp/pr10728-x.cc (main::x): Return by value instead of pointer to
+       coax Clang into emitting the definition of the type.
+       * gdb.cp/pr10728-x.h (y): Ditto.
+       * gdb.cp/pr10728-y.cc (y): Ditto.
+
 2014-04-24  David Blaikie  <dblaikie@gmail.com>
 
        * gdb.base/label.exp: XFAIL label related tests under Clang.
index 7623c0be028ad5856db7fda22d5fef318dc62f2b..d6b766669efe5bec3e5624de54f74d706f746db4 100644 (file)
@@ -2,6 +2,6 @@
 
 int main()
 {
-  X* x = y();
+  X x = y();
   return 0;            // marker 1
 }
index 63737d9bf65bca6187ac289aba31554dfb4123a5..0ba58bb3b540e5cfd3316deee90030c5c253e9d9 100644 (file)
@@ -5,5 +5,5 @@ struct X
   Y* y2;
 };
 
-X* y();
+X y();
 
index 84b222d712d376efa5187afe8906246488779379..d8a932ab41ff0513a54e4db05edac01b0360e257 100644 (file)
@@ -1,11 +1,11 @@
 #include "pr10728-x.h"
 struct Y{};
 
-X* y()
+X y()
 {
-  static X xx;
+  X xx;
   static Y yy;
   xx.y1 = &yy;
   xx.y2 = xx.y1+1;
-  return &xx;
+  return xx;
 }