aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2012-07-02 23:29:58 -0400
committerJason Merrill <jason@gcc.gnu.org>2012-07-02 23:29:58 -0400
commit65f0c5b308fc97731b8d34236c4852ac58db2d29 (patch)
tree4cb39725abc86a626f4738b78602f2db1d5f0044 /gcc
parentd695f91575f13ec3c2392eb192155c835de38f59 (diff)
downloadgcc-65f0c5b308fc97731b8d34236c4852ac58db2d29.zip
gcc-65f0c5b308fc97731b8d34236c4852ac58db2d29.tar.gz
gcc-65f0c5b308fc97731b8d34236c4852ac58db2d29.tar.bz2
re PR c++/53816 (internal compiler error: tree check: expected field_decl, have identifier_node in fixed_type_or_null, at cp/class.c:6419, with -std=c++11 option)
PR c++/53816 * class.c (resolves_to_fixed_type_p): Check uses_template_parms (current_function_decl) instead of processing_template_decl. From-SVN: r189187
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/class.c5
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/template/ref6.C15
4 files changed, 28 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index fb8a34d..f00ff70 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2012-07-02 Jason Merrill <jason@redhat.com>
+ PR c++/53816
+ * class.c (resolves_to_fixed_type_p): Check uses_template_parms
+ (current_function_decl) instead of processing_template_decl.
+
PR c++/53821
* semantics.c (maybe_add_lambda_conv_op): Don't set
DECL_INTERFACE_KNOWN.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 264258c..e70e674 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -6521,7 +6521,10 @@ resolves_to_fixed_type_p (tree instance, int* nonnull)
int cdtorp = 0;
tree fixed;
- if (processing_template_decl)
+ /* processing_template_decl can be false in a template if we're in
+ fold_non_dependent_expr, but we still want to suppress this check. */
+ if (current_function_decl
+ && uses_template_parms (current_function_decl))
{
/* In a template we only care about the type of the result. */
if (nonnull)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index dead281..fc71284 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2012-07-02 Jason Merrill <jason@redhat.com>
+
+ PR c++/53816
+ * g++.dg/template/ref6.C: New.
+
2012-07-03 Oleg Endo <olegendo@gcc.gnu.org>
PR target/53568
diff --git a/gcc/testsuite/g++.dg/template/ref6.C b/gcc/testsuite/g++.dg/template/ref6.C
new file mode 100644
index 0000000..2e1254a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/ref6.C
@@ -0,0 +1,15 @@
+// PR c++/53816
+
+template <typename T>
+struct S { int v () const; };
+template <typename T>
+struct V : public S<T> {};
+struct U
+{
+ V<int> v;
+ template<typename T>
+ struct W
+ {
+ W (U const &x) { V<int> const &v = x.v; v.v(); }
+ };
+};