PR c++/34962, c++/34937, c++/34939
PR c++/34962, c++/34937, c++/34939 * decl2.c (is_late_template_attribute): Always defer attributes vector_size and weak. From-SVN: r132297
This commit is contained in:
parent
1b0c753a86
commit
8d2eb30433
|
@ -1,5 +1,9 @@
|
||||||
2008-02-13 Jason Merrill <jason@redhat.com>
|
2008-02-13 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
PR c++/34962, c++/34937, c++/34939
|
||||||
|
* decl2.c (is_late_template_attribute): Always defer attributes
|
||||||
|
vector_size and weak.
|
||||||
|
|
||||||
PR c++/34774
|
PR c++/34774
|
||||||
* pt.c (value_dependent_expression_p): Look into DECL_INITIAL
|
* pt.c (value_dependent_expression_p): Look into DECL_INITIAL
|
||||||
of enumerators, too.
|
of enumerators, too.
|
||||||
|
|
|
@ -991,6 +991,13 @@ is_late_template_attribute (tree attr, tree decl)
|
||||||
/* Unknown attribute. */
|
/* Unknown attribute. */
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
/* Attribute vector_size handling wants to dive into the back end array
|
||||||
|
building code, which breaks during template processing. */
|
||||||
|
if (is_attribute_p ("vector_size", name)
|
||||||
|
/* Attribute weak handling wants to write out assembly right away. */
|
||||||
|
|| is_attribute_p ("weak", name))
|
||||||
|
return true;
|
||||||
|
|
||||||
/* If any of the arguments are dependent expressions, we can't evaluate
|
/* If any of the arguments are dependent expressions, we can't evaluate
|
||||||
the attribute until instantiation time. */
|
the attribute until instantiation time. */
|
||||||
for (arg = args; arg; arg = TREE_CHAIN (arg))
|
for (arg = args; arg; arg = TREE_CHAIN (arg))
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
// PR c++/34937, 34962
|
||||||
|
// { dg-options "" }
|
||||||
|
|
||||||
|
struct A
|
||||||
|
{
|
||||||
|
static const int i;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<int> void foo()
|
||||||
|
{
|
||||||
|
int x[A::i] __attribute((vector_size(8)));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<int> struct B
|
||||||
|
{
|
||||||
|
enum { a, b = a };
|
||||||
|
void bar(B<b>) __attribute((weak));
|
||||||
|
};
|
||||||
|
|
||||||
|
void f()
|
||||||
|
{
|
||||||
|
foo<0>();
|
||||||
|
B<0> b;
|
||||||
|
b.bar (B<B<0>::b>());
|
||||||
|
}
|
Loading…
Reference in New Issue