+2015-06-29 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/65977
+ * decl.c (grokfndecl): Allow constexpr declarations of friend
+ template specializations.
+
2015-06-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR fortran/66605
}
if (inlinep & 1)
- error ("%<inline%> is not allowed in declaration of friend "
- "template specialization %qD",
- decl);
- if (inlinep & 2)
- error ("%<constexpr%> is not allowed in declaration of friend "
- "template specialization %qD",
- decl);
- if (inlinep)
- return NULL_TREE;
+ {
+ error ("%<inline%> is not allowed in declaration of friend "
+ "template specialization %qD",
+ decl);
+ return NULL_TREE;
+ }
}
}
+2015-06-29 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/65977
+ * g++.dg/cpp0x/constexpr-friend-3.C: New.
+ * g++.dg/cpp0x/constexpr-friend-2.C: Adjust.
+
2015-06-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR fortran/66605
template<typename T> void f(T);
template <class T> class A {
- friend constexpr void f<>(int); // { dg-error "'constexpr' is not allowed" }
+ friend constexpr void f<>(int);
};
--- /dev/null
+// PR c++/65977
+// { dg-do compile { target c++11 } }
+
+template<__SIZE_TYPE__>
+class bitset;
+
+template<__SIZE_TYPE__ N>
+constexpr bool operator==(const bitset<N>&, const bitset<N>&) noexcept;
+
+template<__SIZE_TYPE__ N>
+class bitset
+{
+ friend constexpr bool operator== <>(const bitset<N>&,
+ const bitset<N>&) noexcept;
+};
+
+template<__SIZE_TYPE__ N>
+constexpr bool operator==(const bitset<N>&, const bitset<N>&) noexcept
+{
+ return true;
+}