Commit fece0636 by Jason Merrill Committed by Jason Merrill

re PR c++/53848 (ICE in decl_linkage at ../../gcc-trunk/gcc/cp/tree.c:3215)

	PR c++/53848
	* decl.c (build_enumerator): Don't use build_lang_decl_loc.

From-SVN: r189267
parent 3f1ae742
2012-07-04 Jason Merrill <jason@redhat.com>
PR c++/53848
PR c++/53524
* decl.c (build_enumerator): Don't use build_lang_decl_loc.
2012-07-03 Jakub Jelinek <jakub@redhat.com> 2012-07-03 Jakub Jelinek <jakub@redhat.com>
PR c++/53812 PR c++/53812
......
...@@ -12561,14 +12561,7 @@ incremented enumerator value is too large for %<long%>"); ...@@ -12561,14 +12561,7 @@ incremented enumerator value is too large for %<long%>");
course, if we're processing a template, there may be no value. */ course, if we're processing a template, there may be no value. */
type = value ? TREE_TYPE (value) : NULL_TREE; type = value ? TREE_TYPE (value) : NULL_TREE;
if (context && context == current_class_type) decl = build_decl (loc, CONST_DECL, name, type);
/* This enum declaration is local to the class. We need the full
lang_decl so that we can record DECL_CLASS_CONTEXT, for example. */
decl = build_lang_decl_loc (loc, CONST_DECL, name, type);
else
/* It's a global enum, or it's local to a function. (Note local to
a function could mean local to a class method. */
decl = build_decl (loc, CONST_DECL, name, type);
DECL_CONTEXT (decl) = enumtype; DECL_CONTEXT (decl) = enumtype;
TREE_CONSTANT (decl) = 1; TREE_CONSTANT (decl) = 1;
......
2012-07-04 Jason Merrill <jason@redhat.com>
PR c++/53848
* g++.dg/other/enum3.C: New.
2012-07-04 Uros Bizjak <ubizjak@gmail.com> 2012-07-04 Uros Bizjak <ubizjak@gmail.com>
PR middle-end/53321 PR middle-end/53321
......
// PR c++/53848
extern "C"
{
struct s {
enum {
e = 0
} f;
};
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment