diff options
author | Jason Merrill <jason@redhat.com> | 2014-03-07 15:00:31 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-03-07 15:00:31 -0500 |
commit | d08a068b5e0d964152ee22435567c5279ada25ed (patch) | |
tree | 764677ad4ab0679b3434a88ea863af7f73bc17fd /gcc/cp | |
parent | 941515205deb8586b79b3f02722d2d7a9532539f (diff) | |
download | gcc-d08a068b5e0d964152ee22435567c5279ada25ed.zip gcc-d08a068b5e0d964152ee22435567c5279ada25ed.tar.gz gcc-d08a068b5e0d964152ee22435567c5279ada25ed.tar.bz2 |
typeck.c (comp_template_parms_position): 'auto' and 'decltype(auto)' are different from real template parms.
* typeck.c (comp_template_parms_position): 'auto' and
'decltype(auto)' are different from real template parms.
From-SVN: r208414
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index aa8b914..99a71fb 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2014-03-07 Jason Merrill <jason@redhat.com> + * typeck.c (comp_template_parms_position): 'auto' and + 'decltype(auto)' are different from real template parms. + * parser.c (cp_parser_using_declaration): Consume the semicolon after bare parameter pack error. diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index d8374d9..559f19b5 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -1150,6 +1150,11 @@ comp_template_parms_position (tree t1, tree t2) != TEMPLATE_PARM_PARAMETER_PACK (index2))) return false; + /* In C++14 we can end up comparing 'auto' to a normal template + parameter. Don't confuse them. */ + if (cxx_dialect >= cxx1y && (is_auto (t1) || is_auto (t2))) + return TYPE_IDENTIFIER (t1) == TYPE_IDENTIFIER (t2); + return true; } |