unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Daniel Colascione <daniel@censorshipresearch.org>
To: Emacs development discussions <emacs-devel@gnu.org>, bug-cc-mode@gnu.org
Subject: C++1x support?
Date: Fri, 04 Dec 2009 01:13:19 -0500	[thread overview]
Message-ID: <4B18A87F.4000405@censorshipresearch.org> (raw)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

With upcoming versions of gcc and the-compiler-which-shan't-be-named
supporting huge swaths of the next C++ standard, it's probably
worthwhile to start talking about how to support it.

I've made a short of the things that do and don't work with the current
cc-mode.

Is anyone working on these?


WHAT WORKS:
rvalue references (which are spelled with double ampersands) are fine.

user-defined literals and most new string prefixes work fine.

range-based for loops are fontified correctly as far as I can tell.

Amazingly, lambas seem to work (though the new-style return type
specification isn't fontified properly: that is, in

[](int x,
   int y,
   int z) -> obj
    {
        int z = x + y; return z + x;
    }

obj should be fontified as a type.)




WHAT DOESN'T WORK:

New Keywords:
There are new keywords constexpr, nullptr, static_assert, and decltype,
but adding those should be trivial.


New template parsing rules:
'>>' now being parsed as a template argument list ender instead of a
right shift


Type inference:
auto x = somefunction(); // compiler infers type of x

cc-mode highlights x as a type.


Variadic templates:
template<typename... Args> void printf(const char* fmt, Args... args);

cc-mode copes with the function arguments, but it just gives up on the
template arguments. Also, forward-sexp doesn't move over 'Args...': it
stops before the dots.


New strings:
I have a feeling this one might be painful. C++0x has raw strings:
(from Wikipedia)

u8R"XXX[I'm a "raw UTF-8" string.]XXX"
uR"*@[This is a "raw UTF-16" string.]*@"
UR"[This is a "raw UTF-32" string.]"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)

iEYEARECAAYFAksYqH8ACgkQ17c2LVA10VuD8gCgpGdJPc9iHiN3TwyRiWYH9UGY
U7gAn2aA8krugJ5NeNS5Sp5V38CC62+E
=0hgf
-----END PGP SIGNATURE-----




                 reply	other threads:[~2009-12-04  6:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B18A87F.4000405@censorshipresearch.org \
    --to=daniel@censorshipresearch.org \
    --cc=bug-cc-mode@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).