OSDN Git Service

PR c++/13529
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 5 Jan 2004 01:52:57 +0000 (01:52 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 5 Jan 2004 01:52:57 +0000 (01:52 +0000)
* parser.c (cp_parser_postfix_expression): Allow "." to appear in
an offsetof expression.

PR c++/13529
* g++.dg/parse/offsetof3.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75410 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/offsetof3.C [new file with mode: 0644]

index c5d10d8..aac96ee 100644 (file)
@@ -1,5 +1,9 @@
 2004-01-04  Mark Mitchell  <mark@codesourcery.com>
 
+       PR c++/13529
+       * parser.c (cp_parser_postfix_expression): Allow "." to appear in
+       an offsetof expression.
+
        * parser.c (cp_parser_parameter_declaration): Fix comment.
 
        PR c++/12226
index 1a5f9a3..2586047 100644 (file)
@@ -1,5 +1,8 @@
 2004-01-04  Mark Mitchell  <mark@codesourcery.com>
 
+       PR c++/13529
+       * g++.dg/parse/offsetof3.C: New test.
+
        * g++.dg/init/copy7.C: Add missing dg-error markers.
 
        PR c++/12226
diff --git a/gcc/testsuite/g++.dg/parse/offsetof3.C b/gcc/testsuite/g++.dg/parse/offsetof3.C
new file mode 100644 (file)
index 0000000..905e5f5
--- /dev/null
@@ -0,0 +1,11 @@
+// PR c++/13529
+
+#include <cstddef>
+
+struct A { int i; };
+struct B { A a; };
+
+int main()
+{
+  return offsetof(B,a.i) != 0;
+}