re PR c++/86661 (g++ ICE:tree check: expected tree that contains ‘decl minimal’ struc...
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 1 Aug 2018 12:09:33 +0000 (12:09 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 1 Aug 2018 12:09:33 +0000 (12:09 +0000)
/cp
2018-08-01  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/86661
* class.c (note_name_declared_in_class): Use location_of in permerror
instead of DECL_SOURCE_LOCATION (for OVERLOADs).

/testsuite
2018-08-01  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/86661
* g++.dg/lookup/name-clash12.C: New.

From-SVN: r263207

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/lookup/name-clash12.C [new file with mode: 0644]

index 503d8b4a433fdc948e57e7b0eb75723360ac07c2..d66c195131c955a4a7560890b8ee4cd7a1c2fd14 100644 (file)
@@ -1,3 +1,9 @@
+2018-08-01  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/86661
+       * class.c (note_name_declared_in_class): Use location_of in permerror
+       instead of DECL_SOURCE_LOCATION (for OVERLOADs).
+
 2018-07-31  Tom de Vries  <tdevries@suse.de>
 
        PR debug/86687
index c03a82b44f89661b80aed7c15713048512cc4abe..de59831c54e56887942dd48ebeb970024637b0d6 100644 (file)
@@ -8285,7 +8285,7 @@ note_name_declared_in_class (tree name, tree decl)
         A name N used in a class S shall refer to the same declaration
         in its context and when re-evaluated in the completed scope of
         S.  */
-      if (permerror (DECL_SOURCE_LOCATION (decl),
+      if (permerror (location_of (decl),
                     "declaration of %q#D changes meaning of %qD",
                     decl, OVL_NAME (decl)))
        inform (location_of ((tree) n->value),
index 7fcc05da6a9339be66a7b062de8afe5f5f20fa49..7bf890ae8e1461dcfa9d4b6a14769906c0467a25 100644 (file)
@@ -1,3 +1,8 @@
+2018-08-01  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/86661
+       * g++.dg/lookup/name-clash12.C: New.
+
 2018-08-01  Richard Biener  <rguenther@suse.de>
 
        * gcc.dg/tree-ssa/ssa-fre-68.c: New testcase.
diff --git a/gcc/testsuite/g++.dg/lookup/name-clash12.C b/gcc/testsuite/g++.dg/lookup/name-clash12.C
new file mode 100644 (file)
index 0000000..07ed8c3
--- /dev/null
@@ -0,0 +1,9 @@
+// PR c++/86661
+
+typedef int a;  // { dg-message "declared here" }
+namespace {
+class b {
+  a c;
+  template <typename> void a();  // { dg-error "changes meaning" }
+};
+}