summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-18 21:29:01 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-18 21:29:01 +0000
commit02981e593117d78922b80931617e065bd72e4489 (patch)
tree2d280f5f9652eef89bc18abdac0d84dac8c339ae /gcc/cp
parent10902624b667598d302564597c9fd7cf90b80ca9 (diff)
downloadgcc-02981e593117d78922b80931617e065bd72e4489.tar.gz
DR 1155
* pt.c (convert_nontype_argument): Allow internal linkage in C++11 and up. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@226992 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/pt.c8
2 files changed, 11 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 0bf33c8eb6a..2c2cb6d5535 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2015-08-18 Jason Merrill <jason@redhat.com>
+
+ DR 1155
+ * pt.c (convert_nontype_argument): Allow internal linkage in C++11
+ and up.
+
2015-08-17 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/67216
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index b84bda47fd1..eaafaeff569 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -6469,16 +6469,18 @@ convert_nontype_argument (tree type, tree expr, tsubst_flags_t complain)
{
if (complain & tf_error)
error ("%qE is not a valid template argument for type %qT "
- "because it is not an object with external linkage",
+ "because it is not an object with linkage",
expr, type);
return NULL_TREE;
}
- if (!DECL_EXTERNAL_LINKAGE_P (expr))
+ /* DR 1155 allows internal linkage in C++11 and up. */
+ linkage_kind linkage = decl_linkage (expr);
+ if (linkage < (cxx_dialect >= cxx11 ? lk_internal : lk_external))
{
if (complain & tf_error)
error ("%qE is not a valid template argument for type %qT "
- "because object %qD has not external linkage",
+ "because object %qD does not have linkage",
expr, type, expr);
return NULL_TREE;
}