]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/13529 (offsetof() with member-designator containing member access broken)
authorMark Mitchell <mark@codesourcery.com>
Mon, 5 Jan 2004 01:52:57 +0000 (01:52 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Mon, 5 Jan 2004 01:52:57 +0000 (01:52 +0000)
PR c++/13529
* parser.c (cp_parser_postfix_expression): Allow "." to appear in
an offsetof expression.

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

From-SVN: r75410

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

index c5d10d870780dc467debecc1a6f987c748502bf0..aac96ee5af44f3769e7a0a0a2d0afdb8a4593a0a 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 1a5f9a3839611a746b91abf60c64a460003b77c6..258604725b10c2f7b519172d011c8f3970e6c712 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;
+}