re PR c++/57545 (Generation of debug symbols leads to internal compiler error)
PR c++/57545 * pt.c (convert_nontype_argument) [INTEGER_CST]: Force the argument to have the exact type of the parameter. From-SVN: r200831
This commit is contained in:
parent
e7654c6325
commit
7d43f35781
|
@ -1,5 +1,9 @@
|
|||
2013-07-09 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/57545
|
||||
* pt.c (convert_nontype_argument) [INTEGER_CST]: Force the
|
||||
argument to have the exact type of the parameter.
|
||||
|
||||
PR c++/57551
|
||||
* semantics.c (cxx_eval_indirect_ref): Don't try to look through
|
||||
a POINTER_PLUS_EXPR for type punning diagnostic.
|
||||
|
|
|
@ -5521,6 +5521,10 @@ convert_nontype_argument (tree type, tree expr, tsubst_flags_t complain)
|
|||
else
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Avoid typedef problems. */
|
||||
if (TREE_TYPE (expr) != type)
|
||||
expr = fold_convert (type, expr);
|
||||
}
|
||||
/* [temp.arg.nontype]/5, bullet 2
|
||||
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
// PR c++/57545
|
||||
|
||||
template<typename T, long unsigned int N>
|
||||
struct array {
|
||||
T data[N];
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct derived {
|
||||
typedef long unsigned int size_type;
|
||||
static const size_type n = 42;
|
||||
|
||||
array<int, n> a;
|
||||
};
|
Loading…
Reference in New Issue