]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/29106 (sizeof(*var) in expression drops entire line of code out of compile)
authorMark Mitchell <mark@codesourcery.com>
Tue, 14 Nov 2006 17:15:08 +0000 (17:15 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Tue, 14 Nov 2006 17:15:08 +0000 (17:15 +0000)
PR c++/29106
* g++.dg/init/self1.C: New test.

From-SVN: r118819

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/init/self1.C [new file with mode: 0644]

index 3a207cbc8ddb6093cdc1ab470cb02ec9af65edf6..49e77ab5edaba688ff8835ed4095aad42877be4e 100644 (file)
@@ -1,3 +1,8 @@
+2006-11-14  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/29106
+       * g++.dg/init/self1.C: New test.
+
 2006-11-14  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/29657
diff --git a/gcc/testsuite/g++.dg/init/self1.C b/gcc/testsuite/g++.dg/init/self1.C
new file mode 100644 (file)
index 0000000..dd37c8e
--- /dev/null
@@ -0,0 +1,19 @@
+// PR c++/29106
+// { dg-do run } 
+
+int i;
+
+void f(__SIZE_TYPE__) {
+  i = 3;
+}
+
+
+int main()
+{
+  int* const savepos = sizeof(*savepos) ? 0 : 0;
+
+  f (sizeof (*savepos));
+
+  if (i != 3)
+    return 1;
+}