Hyperlinked C++ BNF Grammar

By Alessio Marchetti

Version 3.6

Last updated: 10-Aug-2021


Purpose of this document

If you are a C++ developer then you sometimes need to have a look at the C++ BNF grammar. At least I do.

But reading a set of BNF rules is difficult since you have to jump from one rule to the next one, maybe pages away from it.

With this document I tried to make it easier to navigate among the BNF rules of the C++ language grammar; you can find here a hyperlinked graph whose nodes are the BNF productions of the C++ language grammar.

If you find errors or inconsistencies, please log an issue.

The BNF non-terminal for a C++ translation unit (translation-unit) is defined here.

The BNF non-terminal for a C++ preprocessing file (preprocessing-file) is defined here.


BNF Grammar Rules

 

lex.charset

hex-quad:  
  hexadecimal-digit hexadecimal-digit hexadecimal-digit hexadecimal-digit
universal-character-name:  
  \u hex-quad
  \U hex-quad hex-quad
 

lex.pptoken

preprocessing-token:  
  header-name
  identifier
  pp-number
  character-literal
  user-defined-character-literal     C++0x
  string-literal
  user-defined-string-literal     C++0x
  preprocessing-op-or-punc
  each non-white-space character that cannot be one of the above
 

lex.token

token:  
  identifier
  keyword
  literal
  operator-token See C++ Standard Core Language Issue n. 189
  punctuator See C++ Standard Core Language Issue n. 189
 

lex.header

header-name:  
  < h-char-sequence >
  " q-char-sequence "
h-char-sequence:  
  h-char
  h-char-sequence h-char
h-char:  
  any member of the source character set except new-line and >
q-char-sequence:  
  q-char
  q-char-sequence q-char
q-char:  
  any member of the source character set except new-line and "
 

lex.ppnumber

pp-number:  
  digit
  . digit
  pp-number digit
  pp-number identifier-nondigit
  pp-number e sign
  pp-number E sign
  pp-number .
 

lex.name

identifier:  
  identifier-nondigit     C++0x
  identifier identifier-nondigit     C++0x
  identifier digit
identifier-nondigit:  
  nondigit     C++0x
  universal-character-name     C++0x
  other implementation-defined characters     C++0x
nondigit:  
  universal-character-name     Removed in C++0x
  a
  b
  c
  d
  e
  f
  g
  h
  i
  j
  k
  l
  m
  n
  o
  p
  q
  r
  s
  t
  u
  v
  w
  x
  y
  z
  A
  B
  C
  D
  E
  F
  G
  H
  I
  J
  K
  L
  M
  N
  O
  P
  Q
  R
  S
  T
  U
  V
  W
  X
  Y
  Z
  _     (underscore)
digit:  
  0
  1
  2
  3
  4
  5
  6
  7
  8
  9
 

lex.key

keyword:  
  alignas     C++0x
  alignof     C++0x
  asm
  auto
  bool
  break
  case
  catch
  char
  char16_t     C++0x
  char32_t     C++0x
  class
  const
  constexpr     C++0x
  const_cast
  continue
  decltype     C++0x
  default
  delete
  do
  double
  dynamic_cast
  else
  enum
  explicit
  export     C++0x - Reserved for future use
  extern
  false
  float
  for
  friend
  goto
  if
  inline
  int
  long
  mutable
  namespace
  new
  noexcept     C++0x
  nullptr     C++0x
  operator
  private
  protected
  public
  register
  reinterpret_cast
  return
  short
  signed
  sizeof
  static
  static_assert     C++0x
  static_cast
  struct
  switch
  template
  this
  thread_local     C++0x
  throw
  true
  try
  typedef
  typeid
  typename
  union
  unsigned
  using
  virtual
  void
  volatile
  wchar_t
  while
 

lex.operators

operator-token:  
  Look at preprocessing-op-or-punc below See C++ Standard Core Language Issue n. 189
punctuator:  
  Look at preprocessing-op-or-punc below See C++ Standard Core Language Issue n. 189
preprocessing-op-or-punc:  
  {
  }
  [
  ]
  #
  ##
  (
  )
  <:
  :>
  <%
  %>
  %:
  %:%:
  ;
  :
  ...
  new
  delete
  ?
  ::
  .
  .*
  +
  -
  *
  /
  %
  ^
  &
  |
  ~
  !
  =
  <
  >
  +=
  -=
  *=
  /=
  %=
  ^=
  &=
  |=
  <<
  >>
  <<=
  >>=
  ==
  !=
  <=
  >=
  &&
  ||
  ++
  --
  ,
  ->*
  ->
  and
  and_eq
  bitand
  bitor
  compl
  not
  not_eq
  or
  or_eq
  xor
  xor_eq
 

lex.literal.kinds

literal:  
  integer-literal
  character-literal
  floating-literal
  string-literal
  boolean-literal
  pointer-literal     C++0x
  user-defined-literal     C++0x
 

lex.icon

integer-literal:  
  decimal-literal integer-suffixopt
  octal-literal integer-suffixopt
  hexadecimal-literal integer-suffixopt
decimal-literal:  
  nonzero-digit
  decimal-literal digit
octal-literal:  
  0
  octal-literal octal-digit
hexadecimal-literal:  
  0x hexadecimal-digit
  0X hexadecimal-digit
  hexadecimal-literal hexadecimal-digit
nonzero-digit:  
  1
  2
  3
  4
  5
  6
  7
  8
  9
octal-digit:  
  0
  1
  2
  3
  4
  5
  6
  7
hexadecimal-digit:  
  0
  1
  2
  3
  4
  5
  6
  7
  8
  9
  a
  b
  c
  d
  e
  f
  A
  B
  C
  D
  E
  F
integer-suffix:  
  unsigned-suffix long-suffixopt
  unsigned-suffix long-long-suffixopt     C++0x
  long-suffix unsigned-suffixopt
  long-long-suffix unsigned-suffixopt     C++0x
unsigned-suffix:  
  u
  U
long-suffix:  
  l
  L
long-long-suffix:  
  ll     C++0x
  LL     C++0x
 

lex.ccon

character-literal:  
  ' c-char-sequence '
  u ' c-char-sequence '     C++0x
  U ' c-char-sequence '     C++0x
  L ' c-char-sequence '
c-char-sequence:  
  c-char
  c-char-sequence c-char
c-char:  
  any member of the source character set except the single quote ', backslash \, or new-line character
  escape-sequence
  universal-character-name
escape-sequence:  
  simple-escape-sequence
  octal-escape-sequence
  hexadecimal-escape-sequence
simple-escape-sequence:  
  \'
  \"
  \?
  \\
  \a
  \b
  \f
  \n
  \r
  \t
  \v
octal-escape-sequence:  
  \ octal-digit
  \ octal-digit octal-digit
  \ octal-digit octal-digit octal-digit
hexadecimal-escape-sequence:  
  \x hexadecimal-digit
  hexadecimal-escape-sequence hexadecimal-digit
 

lex.fcon

floating-literal:  
  fractional-constant exponent-partopt floating-suffixopt
  digit-sequence exponent-part floating-suffixopt
fractional-constant:  
  digit-sequenceopt . digit-sequence
  digit-sequence .
exponent-part:  
  e signopt digit-sequence
  E signopt digit-sequence
sign:  
  +
  -
digit-sequence:  
  digit
  digit-sequence digit
floating-suffix:  
  f
  l
  F
  L
 

lex.string

string-literal:  
  encoding-prefixopt " s-char-sequenceopt "     C++0x
  encoding-prefixopt R raw-string     C++0x
encoding-prefix:  
  u8     C++0x
  u     C++0x
  U     C++0x
  L     C++0x
s-char-sequence:  
  s-char
  s-char-sequence s-char
s-char:  
  any member of the source character set except the double-quote ", backslash \, or new-line character
  escape-sequence
  universal-character-name
raw-string:  
  " d-char-sequenceopt ( r-char-sequenceopt ) d-char-sequenceopt "     C++0x
r-char-sequence:  
  r-char     C++0x
  r-char-sequence r-char     C++0x
r-char:  
  any member of the source character set, except a right parenthesis ) followed by the initial d-char-sequence (which may be empty) followed by a double quote ".     C++0x
d-char-sequence:  
  d-char     C++0x
  d-char-sequence d-char     C++0x
d-char:  
  any member of the basic source character set, except: space, the left parenthesis (, the right parenthesis ), the backslash \, and the control characters representing horizontal tab, vertical tab, form feed, and newline.     C++0x
 

lex.bool

boolean-literal:  
  false
  true
 

lex.nullptr

pointer-literal:  
  nullptr     C++0x
 

lex.ext

user-defined-literal:  
  user-defined-integer-literal     C++0x
  user-defined-floating-literal     C++0x
  user-defined-string-literal     C++0x
  user-defined-character-literal     C++0x
user-defined-integer-literal:  
  decimal-literal ud-suffix     C++0x
  octal-literal ud-suffix     C++0x
  hexadecimal-literal ud-suffix     C++0x
user-defined-floating-literal:  
  fractional-constant exponent-partopt ud-suffix     C++0x
  digit-sequence exponent-part ud-suffix     C++0x
user-defined-string-literal:  
  string-literal ud-suffix     C++0x
user-defined-character-literal:  
  character-literal ud-suffix     C++0x
ud-suffix:  
  identifier     C++0x
 

basic.link

translation-unit:  
  declaration-seqopt
 

expr.prim.general

primary-expression:  
  literal
  this
  ( expression )
  id-expression
  lambda-expression     C++0x
id-expression:  
  unqualified-id
  qualified-id
unqualified-id:  
  identifier
  operator-function-id
  conversion-function-id
  literal-operator-id     C++0x
  ~ class-name
  ~ decltype-specifier     C++0x
  template-id
qualified-id:  
  ::opt nested-name-specifier templateopt unqualified-id
  :: identifier
  :: operator-function-id
  :: literal-operator-id     C++0x
  :: template-id
nested-name-specifier:  
  type-name ::
  namespace-name ::
  decltype-specifier ::     C++0x
  nested-name-specifier identifier ::
  nested-name-specifier templateopt simple-template-id ::
 

expr.prim.lambda

lambda-expression:  
  lambda-introducer lambda-declaratoropt compound-statement     C++0x
lambda-introducer:  
  [ lambda-captureopt ]     C++0x
lambda-capture:  
  capture-default     C++0x
  capture-list     C++0x
  capture-default , capture-list     C++0x
capture-default:  
  &     C++0x
  =     C++0x
capture-list:  
  capture ...opt     C++0x
  capture-list , capture ...opt     C++0x
capture:  
  identifier     C++0x
  & identifier     C++0x
  this     C++0x
lambda-declarator:  
  ( parameter-declaration-clause ) mutableopt exception-specificationopt attribute-specifier-seqopt trailing-return-typeopt     C++0x
 

expr.post

postfix-expression:  
  primary-expression
  postfix-expression [ expression ]
  postfix-expression [ braced-init-listopt ]     C++0x
  postfix-expression ( expression-listopt )
  simple-type-specifier ( expression-listopt )
  typename-specifier ( expression-listopt )
  simple-type-specifier braced-init-list     C++0x
  typename-specifier braced-init-list     C++0x
  postfix-expression . templateopt id-expression
  postfix-expression -> templateopt id-expression
  postfix-expression . pseudo-destructor-name
  postfix-expression -> pseudo-destructor-name
  postfix-expression ++
  postfix-expression --
  dynamic_cast < type-id > ( expression )
  static_cast < type-id > ( expression )
  reinterpret_cast < type-id > ( expression )
  const_cast < type-id > ( expression )
  typeid ( expression )
  typeid ( type-id )
expression-list:  
  initializer-list
pseudo-destructor-name:  
  ::opt nested-name-specifieropt type-name :: ~ type-name
  ::opt nested-name-specifier template simple-template-id :: ~ type-name     C++0x
  ::opt nested-name-specifieropt ~ type-name
  ~ decltype-specifier     C++0x
 

expr.unary

unary-expression:  
  postfix-expression
  ++ cast-expression
  -- cast-expression
  unary-operator cast-expression
  sizeof unary-expression
  sizeof ( type-id )
  sizeof ... ( identifier )     C++0x
  alignof ( type-id )     C++0x
  noexcept-expression     C++0x
  new-expression
  delete-expression
unary-operator:  
  *
  &
  +
  -
  !
  ~
 

expr.new

new-expression:  
  ::opt new new-placementopt new-type-id new-initializeropt
  ::opt new new-placementopt ( type-id ) new-initializeropt
new-placement:  
  ( expression-list )
new-type-id:  
  type-specifier-seq new-declaratoropt
new-declarator:  
  ptr-operator new-declaratoropt
  noptr-new-declarator     C++0x
noptr-new-declarator:  
  [ expression ] attribute-specifier-seqopt     C++0x
  noptr-new-declarator [ constant-expression ] attribute-specifier-seqopt     C++0x
new-initializer:  
  ( expression-listopt )
  braced-init-list     C++0x
 

expr.delete

delete-expression:  
  ::opt delete cast-expression
  ::opt delete [ ] cast-expression
 

expr.unary.noexcept

noexcept-expression:  
  noexcept ( expression )     C++0x
 

expr.cast

cast-expression:  
  unary-expression
  ( type-id ) cast-expression
 

expr.mptr.oper

pm-expression:  
  cast-expression
  pm-expression .* cast-expression
  pm-expression ->* cast-expression
 

expr.mul

multiplicative-expression:  
  pm-expression
  multiplicative-expression * pm-expression
  multiplicative-expression / pm-expression
  multiplicative-expression % pm-expression
 

expr.add

additive-expression:  
  multiplicative-expression
  additive-expression + multiplicative-expression
  additive-expression - multiplicative-expression
 

expr.shift

shift-expression:  
  additive-expression
  shift-expression << additive-expression
  shift-expression >> additive-expression
 

expr.rel

relational-expression:  
  shift-expression
  relational-expression < shift-expression
  relational-expression > shift-expression
  relational-expression <= shift-expression
  relational-expression >= shift-expression
 

expr.eq

equality-expression:  
  relational-expression
  equality-expression == relational-expression
  equality-expression != relational-expression
 

expr.bit.and

and-expression:  
  equality-expression
  and-expression & equality-expression
 

expr.xor

exclusive-or-expression:  
  and-expression
  exclusive-or-expression ^ and-expression
 

expr.or

inclusive-or-expression:  
  exclusive-or-expression
  inclusive-or-expression | exclusive-or-expression
 

expr.log.and

logical-and-expression:  
  inclusive-or-expression
  logical-and-expression && inclusive-or-expression
 

expr.log.or

logical-or-expression:  
  logical-and-expression
  logical-or-expression || logical-and-expression
 

expr.cond

conditional-expression:  
  logical-or-expression
  logical-or-expression ? expression : assignment-expression
 

expr.ass

assignment-expression:  
  conditional-expression
  logical-or-expression assignment-operator initializer-clause     C++0x
  throw-expression
assignment-operator:  
  =
  *=
  /=
  %=
  +=
  -=
  >>=
  <<=
  &=
  ^=
  |=
 

expr.comma

expression:  
  assignment-expression
  expression , assignment-expression
 

expr.const

constant-expression:  
  conditional-expression
 

stmt.stmt

statement:  
  labeled-statement
  attribute-specifier-seqopt expression-statement     C++0x
  attribute-specifier-seqopt compound-statement     C++0x
  attribute-specifier-seqopt selection-statement     C++0x
  attribute-specifier-seqopt iteration-statement     C++0x
  attribute-specifier-seqopt jump-statement     C++0x
  declaration-statement
  attribute-specifier-seqopt try-block
 

stmt.label

labeled-statement:  
  attribute-specifier-seqopt identifier : statement
  attribute-specifier-seqopt case constant-expression : statement
  attribute-specifier-seqopt default : statement
 

stmt.expr

expression-statement:  
  expressionopt ;
 

stmt.block

compound-statement:  
  { statement-seqopt }
statement-seq:  
  statement
  statement-seq statement
 

stmt.select

selection-statement:  
  if ( condition ) statement
  if ( condition ) statement else statement
  switch ( condition ) statement
condition:  
  expression
  attribute-specifier-seqopt decl-specifier-seq declarator = initializer-clause     C++0x
  attribute-specifier-seqopt decl-specifier-seq declarator braced-init-list     C++0x
 

stmt.iter

iteration-statement:  
  while ( condition ) statement
  do statement while ( expression ) ;
  for ( for-init-statement conditionopt ; expressionopt ) statement
  for ( for-range-declaration : for-range-initializer ) statement     C++0x
for-init-statement:  
  expression-statement
  simple-declaration
for-range-declaration:  
  attribute-specifier-seqopt type-specifier-seq declarator     C++0x
for-range-initializer:  
  expression
  braced-init-list
 

stmt.jump

jump-statement:  
  break ;
  continue ;
  return expressionopt ;
  return braced-init-listopt ;     C++0x
  goto identifier ;
 

stmt.dcl

declaration-statement:  
  block-declaration
 

dcl.dcl

declaration-seq:  
  declaration
  declaration-seq declaration
declaration:  
  block-declaration
  function-definition
  template-declaration
  explicit-instantiation
  explicit-specialization
  linkage-specification
  namespace-definition
  empty-declaration     C++0x
  attribute-declaration     C++0x
block-declaration:  
  simple-declaration
  asm-definition
  namespace-alias-definition
  using-declaration
  using-directive
  static_assert-declaration     C++0x
  alias-declaration     C++0x
  opaque-enum-declaration     C++0x
alias-declaration:  
  using identifier = type-id ;     C++0x
simple-declaration:  
  attribute-specifier-seqopt decl-specifier-seqopt init-declarator-listopt ;     C++0x
static_assert-declaration:  
  static_assert ( constant-expression , string-literal ) ;     C++0x
empty-declaration:  
  ;     C++0x
attribute-declaration:  
  attribute-specifier-seq ;     C++0x
 

dcl.spec

decl-specifier:  
  storage-class-specifier
  type-specifier
  function-specifier
  friend
  typedef
  constexpr     C++0x
decl-specifier-seq:  
  decl-specifier attribute-specifier-seqopt     C++0x
  decl-specifier decl-specifier-seq     C++0x
 

dcl.stc

storage-class-specifier:  
  auto     Removed in C++0x
  register
  static
  thread_local     C++0x
  extern
  mutable
 

dcl.fct.spec

function-specifier:  
  inline
  virtual
  explicit
 

dcl.typedef

typedef-name:  
  identifier
 

dcl.type

type-specifier:  
  trailing-type-specifier
  class-specifier
  enum-specifier
trailing-type-specifier:  
  simple-type-specifier
  elaborated-type-specifier
  typename-specifier
  cv-qualifier
type-specifier-seq:  
  type-specifier attribute-specifier-seqopt     C++0x
  type-specifier type-specifier-seq
trailing-type-specifier-seq:  
  trailing-type-specifier attribute-specifier-seqopt     C++0x
  trailing-type-specifier trailing-type-specifier-seq     C++0x
 

dct.type.simple

simple-type-specifier:  
  ::opt nested-name-specifieropt type-name
  ::opt nested-name-specifier template simple-template-id
  char
  char16_t     C++0x
  char32_t     C++0x
  wchar_t
  bool
  short
  int
  long
  signed
  unsigned
  float
  double
  void
  auto     C++0x
  decltype-specifier     C++0x
type-name:  
  class-name
  enum-name
  typedef-name
  simple-template-id     C++0x
decltype-specifier:  
  decltype ( expression )     C++0x
 

dcl.type.elab

elaborated-type-specifier:  
  class-key attribute-specifier-seqopt ::opt nested-name-specifieropt identifier
  class-key ::opt nested-name-specifieropt templateopt simple-template-id
  enum ::opt nested-name-specifieropt identifier
 

dcl.enum

enum-name:  
  identifier
enum-specifier:  
  enum-head { enumerator-listopt }     C++0x
  enum-head { enumerator-list , }     C++0x
enum-head:  
  enum-key attribute-specifier-seqopt identifieropt enum-baseopt     C++0x
  enum-key attribute-specifier-seqopt nested-name-specifier identifier enum-baseopt     C++0x
opaque-enum-declaration:  
  enum-key attribute-specifier-seqopt identifier enum-baseopt ;     C++0x
enum-key:  
  enum     C++0x
  enum class     C++0x
  enum struct     C++0x
enum-base:  
  : type-specifier-seq     C++0x
enumerator-list:  
  enumerator-definition     C++0x
  enumerator-list , enumerator-definition     C++0x
enumerator-definition:  
  enumerator
  enumerator = constant-expression
enumerator:  
  identifier
 

namespace.def

namespace-name:  
  original-namespace-name
  namespace-alias
original-namespace-name:  
  identifier
namespace-definition:  
  named-namespace-definition
  unnamed-namespace-definition
named-namespace-definition:  
  original-namespace-definition
  extension-namespace-definition
original-namespace-definition:  
  inlineopt namespace identifier { namespace-body }     C++0x
extension-namespace-definition:  
  inlineopt namespace original-namespace-name { namespace-body }     C++0x
unnamed-namespace-definition:  
  inlineopt namespace { namespace-body }
namespace-body:  
  declaration-seqopt
 

namespace.alias

namespace-alias:  
  identifier
namespace-alias-definition:  
  namespace identifier = qualified-namespace-specifier ;
qualified-namespace-specifier:  
  ::opt nested-name-specifieropt namespace-name
 

namespace.udecl

using-declaration:  
  using typenameopt ::opt nested-name-specifier unqualified-id ;
  using :: unqualified-id ;
 

namespace.udir

using-directive:  
  attribute-specifier-seqopt using namespace ::opt nested-name-specifieropt namespace-name ;
 

dcl.asm

asm-definition:  
  asm ( string-literal ) ;
 

dcl.link

linkage-specification:  
  extern string-literal { declaration-seqopt }
  extern string-literal declaration
 

dcl.attr.grammar

attribute-specifier-seq:  
  attribute-specifier     C++0x
  attribute-specifier-seq attribute-specifier     C++0x
attribute-specifier:  
  [ [ attribute-list ] ]     C++0x
  alignment-specifier     C++0x
alignment-specifier:  
  alignas ( type-id ...opt )     C++0x
  alignas ( assignment-expression ...opt )     C++0x
attribute-list:  
  attributeopt     C++0x
  attribute-list , attributeopt     C++0x
  attribute ...     C++0x
  attribute-list , attribute ...     C++0x
attribute:  
  attribute-token attribute-argument-clauseopt     C++0x
attribute-token:  
  identifier     C++0x
  attribute-scoped-token     C++0x
attribute-scoped-token:  
  attribute-namespace :: identifier     C++0x
attribute-namespace:  
  identifier     C++0x
attribute-argument-clause:  
  ( balanced-token-seq )     C++0x
balanced-token-seq:  
  balanced-token     C++0x
  balanced-token-seq balanced-token     C++0x
balanced-token:  
  ( balanced-token-seq )     C++0x
  [ balanced-token-seq ]     C++0x
  { balanced-token-seq }     C++0x
  token     C++0x - except a parenthesis, a bracket, or a brace
 

dcl.decl

init-declarator-list:  
  init-declarator
  init-declarator-list , init-declarator
init-declarator:  
  declarator initializeropt
declarator:  
  ptr-declarator     C++0x
  noptr-declarator parameters-and-qualifiers trailing-return-type     C++0x
ptr-declarator:  
  noptr-declarator     C++0x
  ptr-operator ptr-declarator     C++0x
noptr-declarator:  
  declarator-id attribute-specifier-seqopt     C++0x
  noptr-declarator parameters-and-qualifiers     C++0x
  noptr-declarator [ constant-expressionopt ] attribute-specifier-seqopt     C++0x
  ( ptr-declarator )     C++0x
parameters-and-qualifiers:  
  ( parameter-declaration-clause ) attribute-specifier-seqopt cv-qualifier-seqopt ref-qualifieropt exception-specificationopt     C++0x
trailing-return-type:  
  -> trailing-type-specifier-seq abstract-declaratoropt     C++0x
ptr-operator:  
  * attribute-specifier-seqopt cv-qualifier-seqopt     C++0x
  & attribute-specifier-seqopt     C++0x
  && attribute-specifier-seqopt     C++0x
  ::opt nested-name-specifier * attribute-specifier-seqopt cv-qualifier-seqopt     C++0x
cv-qualifier-seq:  
  cv-qualifier
  cv-qualifier cv-qualifier-seq
cv-qualifier:  
  const
  volatile
ref-qualifier:  
  &     C++0x
  &&     C++0x
declarator-id:  
  ...opt id-expression     C++0x
  ::opt nested-name-specifieropt class-name     C++0x
 

dcl.name

type-id:  
  type-specifier-seq abstract-declaratoropt
abstract-declarator:  
  ptr-abstract-declarator     C++0x
  noptr-abstract-declaratoropt parameters-and-qualifiers trailing-return-type     C++0x
  ...     C++0x
ptr-abstract-declarator:  
  noptr-abstract-declarator     C++0x
  ptr-operator ptr-abstract-declaratoropt     C++0x
noptr-abstract-declarator:  
  noptr-abstract-declaratoropt parameters-and-qualifiers     C++0x
  noptr-abstract-declaratoropt [ constant-expression ] attribute-specifier-seqopt     C++0x
  ( ptr-abstract-declarator )     C++0x
 

dcl.fct

parameter-declaration-clause:  
  parameter-declaration-listopt ...opt
  parameter-declaration-list , ...
parameter-declaration-list:  
  parameter-declaration
  parameter-declaration-list , parameter-declaration
parameter-declaration:  
  attribute-specifier-seqopt decl-specifier-seq declarator     C++0x
  attribute-specifier-seqopt decl-specifier-seq declarator = initializer-clause     C++0x
  attribute-specifier-seqopt decl-specifier-seq abstract-declaratoropt     C++0x
  attribute-specifier-seqopt decl-specifier-seq abstract-declaratoropt = initializer-clause     C++0x
 

dcl.fct.def.general

function-definition:  
  attribute-specifier-seqopt decl-specifier-seqopt declarator function-body     C++0x
  attribute-specifier-seqopt decl-specifier-seqopt declarator = default ;     C++0x
  attribute-specifier-seqopt decl-specifier-seqopt declarator = delete ;     C++0x
function-body:  
  ctor-initializeropt compound-statement     C++0x
  function-try-block     C++0x
 

dcl.init

initializer:  
  brace-or-equal-initializer     C++0x
  ( expression-list )     C++0x
brace-or-equal-initializer:  
  = initializer-clause     C++0x
  braced-init-list     C++0x
initializer-clause:  
  assignment-expression     C++0x
  braced-init-list     C++0x
initializer-list:  
  initializer-clause ...opt     C++0x
  initializer-list , initializer-clause ...opt     C++0x
braced-init-list:  
  { initializer-list ,opt }     C++0x
  { }     C++0x
 

class

class-name:  
  identifier
  simple-template-id     C++0x
class-specifier:  
  class-head { member-specificationopt }
class-head:  
  class-key attribute-specifier-seqopt class-head-name class-virt-specifier-seqopt base-clauseopt     C++0x
  class-key attribute-specifier-seqopt base-clauseopt     C++0x
class-head-name:  
  nested-name-specifieropt class-name     C++0x
class-virt-specifier-seq:  
  class-virt-specifier     C++0x
  class-virt-specifier-seq class-virt-specifier     C++0x
class-virt-specifier:  
  final     C++0x
class-key:  
  class
  struct
  union
 

class.mem

member-specification:  
  member-declaration member-specificationopt
  access-specifier : member-specificationopt
member-declaration:  
  attribute-specifier-seqopt decl-specifier-seqopt member-declarator-listopt ;     C++0x
  function-definition ;opt
  using-declaration
  static_assert-declaration     C++0x
  template-declaration
  alias-declaration     C++0x
member-declarator-list:  
  member-declarator
  member-declarator-list , member-declarator
member-declarator:  
  declarator virt-specifier-seqopt pure-specifieropt
  declarator virt-specifier-seqopt brace-or-equal-initializeropt     C++0x
  identifieropt attribute-specifier-seqopt virt-specifier-seqopt : constant-expression
virt-specifier-seq:  
  virt-specifier
  virt-specifier-seq virt-specifier
virt-specifier:  
  override
  final
  new
pure-specifier:  
  = 0
 

class.derived

base-clause:  
  : base-specifier-list
base-specifier-list:  
  base-specifier ...opt     C++0x
  base-specifier-list , base-specifier ...opt     C++0x
base-specifier:  
  attribute-specifier-seqopt base-type-specifier     C++0x
  attribute-specifier-seqopt virtual access-specifieropt base-type-specifier     C++0x
  attribute-specifier-seqopt access-specifier virtualopt base-type-specifier     C++0x
class-or-decltype:  
  ::opt nested-name-specifieropt class-name     C++0x
  decltype-specifier     C++0x
base-type-specifier:  
  class-or-decltype     C++0x
access-specifier:  
  private
  protected
  public
 

class.conv.fct

conversion-function-id:  
  operator conversion-type-id
conversion-type-id:  
  type-specifier-seq conversion-declaratoropt
conversion-declarator:  
  ptr-operator conversion-declaratoropt
 

class.base.init

ctor-initializer:  
  : mem-initializer-list
mem-initializer-list:  
  mem-initializer ...opt     C++0x
  mem-initializer , mem-initializer-list ...opt     C++0x
mem-initializer:  
  mem-initializer-id ( expression-listopt )
  mem-initializer-id braced-init-list     C++0x
mem-initializer-id:  
  class-or-decltype
  identifier
 

over.oper

operator-function-id: See C++ Standard Core Language Issue n. 189
  operator overloadable-operator
  operator overloadable-operator < template-argument-listopt >
overloadable-operator: See C++ Standard Core Language Issue n. 189
  new
  delete
  new [ ]
  delete [ ]
  +
  -
  *
  /
  %
  ^
  &
  |
  ~
  !
  =
  <
  >
  +=
  -=
  *=
  /=
  %=
  ^=
  &=
  |=
  <<
  >>
  >>=
  <<=
  ==
  !=
  <=
  >=
  &&
  ||
  ++
  --
  ,
  ->*
  ->
  ()
  []
 

over.literal

literal-operator-id:  
  operator "" identifier     C++0x
 

temp

template-declaration:  
  template < template-parameter-list > declaration     C++0x - The export keyword is reserved for future use
template-parameter-list:  
  template-parameter
  template-parameter-list , template-parameter
 

temp.param

template-parameter:  
  type-parameter
  parameter-declaration
type-parameter:  
  class ...opt identifieropt     C++0x
  class identifieropt = type-id
  typename ...opt identifieropt     C++0x
  typename identifieropt = type-id
  template < template-parameter-list > class ...opt identifieropt     C++0x
  template < template-parameter-list > class identifieropt = id-expression
 

temp.names

simple-template-id:  
  template-name < template-argument-listopt >     C++0x
template-id:  
  simple-template-id     C++0x
  operator-function-id < template-argument-listopt >     C++0x
  literal-operator-id < template-argument-listopt >     C++0x
template-name:  
  identifier
template-argument-list:  
  template-argument ...opt     C++0x
  template-argument-list , template-argument ...opt     C++0x
template-argument:  
  constant-expression     C++0x
  type-id     C++0x
  id-expression     C++0x
 

temp.res

typename-specifier:  
  typename ::opt nested-name-specifier identifier     C++0x
  typename ::opt nested-name-specifier templateopt simple-template-id     C++0x
 

temp.explicit

explicit-instantiation:  
  externopt template declaration     C++0x
 

temp.expl.spec

explicit-specialization:  
  template < > declaration
 

except

try-block:  
  try compound-statement handler-seq
function-try-block:  
  try ctor-initializeropt compound-statement handler-seq     C++0x
handler-seq:  
  handler
  handler handler-seq
handler:  
  catch ( exception-declaration ) compound-statement
exception-declaration:  
  attribute-specifier-seqopt type-specifier-seq declarator     C++0x
  attribute-specifier-seqopt type-specifier-seq abstract-declaratoropt     C++0x
  ...     C++0x
throw-expression:  
  throw assignment-expressionopt
 

except.spec

exception-specification:  
  dynamic-exception-specification     C++0x
  noexcept-specification     C++0x
dynamic-exception-specification:  
  throw ( type-id-listopt )     C++0x
type-id-list:  
  type-id ...opt     C++0x
  type-id-list , type-id ...opt     C++0x
noexcept-specification:  
  noexcept ( constant-expression )     C++0x
  noexcept     C++0x
 

cpp

preprocessing-file:  
  groupopt
group:  
  group-part
  group group-part
group-part:  
  if-section
  control-line
  text-line     C++0x
  # non-directive     C++0x
if-section:  
  if-group elif-groupsopt else-groupopt endif-line
if-group:  
  # if constant-expression new-line groupopt
  # ifdef identifier new-line groupopt
  # ifndef identifier new-line groupopt
elif-groups:  
  elif-group
  elif-groups elif-group
elif-group:  
  # elif constant-expression new-line groupopt
else-group:  
  # else new-line groupopt
endif-line:  
  # endif new-line
control-line:  
  # include pp-tokens new-line
  # define identifier replacement-list new-line
  # define identifier lparen identifier-listopt ) replacement-list new-line     C++0x
  # define identifier lparen identifier-list , ... ) replacement-list new-line     C++0x
  # undef identifier new-line
  # line pp-tokens new-line
  # error pp-tokensopt new-line
  # pragma pp-tokensopt new-line
  # new-line
text-line:  
  pp-tokensopt new-line     C++0x
non-directive:  
  pp-tokens new-line     C++0x
lparen:  
  a ( character not immediately preceded by white-space
identifier-list:  
  identifier
  identifier-list , identifier
replacement-list:  
  pp-tokensopt
pp-tokens:  
  preprocessing-token
  pp-tokens preprocessing-token
new-line:  
  the new-line character

Back to top