On Tue, 4 Feb 2014, Andreas Schwab wrote:
Marc Glisse <marc.gli...@inria.fr> writes:
Index: gcc/testsuite/g++.dg/cpp0x/constexpr-attribute2.C
===================================================================
--- gcc/testsuite/g++.dg/cpp0x/constexpr-attribute2.C (revision 0)
+++ gcc/testsuite/g++.dg/cpp0x/constexpr-attribute2.C (working copy)
@@ -0,0 +1,32 @@
+// { dg-options -std=gnu++11 }
+
+struct t { t(); };
+
+constexpr int prio = 123;
+constexpr int size = 8;
+constexpr int pos = 1;
+enum A { zero = 0, one, two };
+__attribute__((init_priority(prio))) t a;
+
+enum class E1 : int {
+ first = 101,
+ second,
+ third,
+};
+__attribute__((init_priority(E1::second))) t b; // Should not compile?
+
+enum E2 {
+ E2_first = 141,
+ E2_second,
+ E2_third,
+};
+__attribute__((init_priority(E2_second))) t c;
+
+void* my_calloc(unsigned, unsigned) __attribute__((alloc_size(pos,two)));
+void* my_realloc(void*, unsigned) __attribute__((alloc_size(two)));
+
+typedef char vec __attribute__((vector_size(size)));
+
+void f(char*) __attribute__((nonnull(pos)));
+
+void g() __attribute__((aligned(size)));
/usr/local/gcc/gcc-20140204/gcc/testsuite/g++.dg/cpp0x/constexpr-attribute2.C:32:6:
error: alignment for 'void g()' must be at least 16
(I don't know why we error out for this, align specifies a minimal
alignment, if it ends up more aligned, that's fine)
FAIL: g++.dg/cpp0x/constexpr-attribute2.C (test for excess errors)
It would be nice to at least mention the platform in this kind of email.
Feel free to replace 8 with 16 in the initialization of size (you can
commit it as obvious if it works for you).
Thanks,
--
Marc Glisse