mirror of
https://gcc.gnu.org/git/gcc.git
synced 2025-01-17 01:04:11 +08:00
re PR c++/13791 (ICE in layout_type with packed types)
PR c++/13791 * typeck.c (merge_types): Do not merge attributes into TYPENAME_TYPEs. 2004-01-28 Mark Mitchell <mark@codesourcery.com> PR c++/13791 * g++.dg/ext/attrib12.C: New test. From-SVN: r76837
This commit is contained in:
parent
dc7efe6ea9
commit
b1a95e0b15
@ -1,5 +1,9 @@
|
||||
2004-01-28 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/13791
|
||||
* typeck.c (merge_types): Do not merge attributes into
|
||||
TYPENAME_TYPEs.
|
||||
|
||||
PR c++/13736
|
||||
* parser.c (cp_parser_direct_declarator): Do not prevent
|
||||
backtracking inside a parenthesized declarator.
|
||||
|
@ -714,6 +714,12 @@ merge_types (tree t1, tree t2)
|
||||
break;
|
||||
}
|
||||
|
||||
case TYPENAME_TYPE:
|
||||
/* There is no need to merge attributes into a TYPENAME_TYPE.
|
||||
When the type is instantiated it will have whatever
|
||||
attributes result from the instantiation. */
|
||||
return t1;
|
||||
|
||||
default:;
|
||||
}
|
||||
return build_type_attribute_variant (t1, attributes);
|
||||
|
@ -1,5 +1,8 @@
|
||||
2004-01-28 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/13791
|
||||
* g++.dg/ext/attrib12.C: New test.
|
||||
|
||||
PR c++/13736
|
||||
* g++.dg/parse/cast2.C: New test.
|
||||
|
||||
|
16
gcc/testsuite/g++.dg/ext/attrib12.C
Normal file
16
gcc/testsuite/g++.dg/ext/attrib12.C
Normal file
@ -0,0 +1,16 @@
|
||||
// PR c++/13791
|
||||
|
||||
template <typename T> struct O {
|
||||
struct __attribute__((packed)) I {
|
||||
int i;
|
||||
char c;
|
||||
};
|
||||
|
||||
I* foo();
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
typename O<T>::I*
|
||||
O<T>::foo() { return 0; }
|
||||
|
||||
template class O<int>;
|
Loading…
Reference in New Issue
Block a user