This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81099] New: A single `decltype(this)` at top level triggers 2 identical error messages
- From: "iamsupermouse at mail dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 15 Jun 2017 00:38:16 +0000
- Subject: [Bug c++/81099] New: A single `decltype(this)` at top level triggers 2 identical error messages
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81099
Bug ID: 81099
Summary: A single `decltype(this)` at top level triggers 2
identical error messages
Product: gcc
Version: 7.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: iamsupermouse at mail dot ru
Target Milestone: ---
If `decltype(this)` is used at top level, it triggers *two* identical error
messages. For example:
using T = decltype(this);
Results in:
<source>:1:20: error: invalid use of 'this' at top level
using T = decltype(this);
^~~~
<source>:1:20: error: invalid use of 'this' at top level
On the other hand, following:
auto x = this;
// al well as `using T = decltype(*this);`
triggers a *single* error message:
<source>:1:10: error: invalid use of 'this' at top level
auto x = this;
^~~~