This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11756] ICE's when using typeof in template function parameter type declarations
- From: "jason at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Oct 2007 09:34:22 -0000
- Subject: [Bug c++/11756] ICE's when using typeof in template function parameter type declarations
- References: <bug-11756-5473@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #11 from jason at gcc dot gnu dot org 2007-10-04 09:34 -------
decltype is the C++0x equivalent of the GCC typeof extension; if you replace
the word "typeof" in the testcase with "decltype" and compile with -fstd=c++0x,
the testcase will work as expected. Or you can use "__decltype" without having
to enable C++0x mode.
decltype does not always return the same type as typeof: specifically, when
applied to an lvalue expression which is not a simple id-expression, decltype
gives a reference type. But as used in the testcase for this bug report, the
result is the same.
The other typeof bugs I mentioned can be found in the depends list for bug
12604.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11756