Re: Precedence of GNU C++ extensions >? and <? (min/max operators)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jeremy,

On Sat, Mar 05, 2011 at 10:07:01AM +0000, Jeremy Hall wrote:
> Does anyone know the exact priority of these operators?  Its not
> mentioned in the description of the extension as far as I can see.
As I read the documentation in the gcc-sourcecode, they are the same
precedence as "<", ">", "<=", ">=". They are relation operators and
form a "relational-expression": (§5.9 in C++ standard, [expr.rel])

See line 6258-6296 in
http://gcc.gnu.org/viewcvs/branches/gcc-4_5-branch/gcc/cp/parser.c?view=markup&revision=170622
relational-expression:
  shift-expression
  relational-expression < shift-expression
  relational-expression > shift-expression
  relational-expression <= shift-expression
  relational-expression >= shift-expression

GNU Extension:

relational-expression:
  relational-expression <? shift-expression
  relational-expression >? shift-expression 


HTH,

Axel



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux