diff options
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/dependent-expr4.C | 14 |
2 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 778a82ebc5e..bedd6da40ca 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-01-08 Giovanni Bajo <giovannibajo@gcc.gnu.org> + + PR c++/12573 + * g++.dg/template/dependent-expr4.C: New test. + 2004-01-08 Hartmut Penner <hpenner@de.ibm.com> * gcc.dg/altivec-11.c: New test. diff --git a/gcc/testsuite/g++.dg/template/dependent-expr4.C b/gcc/testsuite/g++.dg/template/dependent-expr4.C new file mode 100644 index 00000000000..066436b66fb --- /dev/null +++ b/gcc/testsuite/g++.dg/template/dependent-expr4.C @@ -0,0 +1,14 @@ +// { dg-do compile }
+// Origin: jbrandmeyer at users dot sourceforge dot net
+// PR c++/12573: COMPONENT_REFs must be inspected for dependness.
+
+template <bool> struct S;
+
+template <typename K> struct Y {
+ int x;
+};
+
+template <class T> struct Z {
+ S< (bool)(__offsetof__(&static_cast<Y<T>*>(0)->x) == 0) >
+ s;
+};
|