Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++.moderated > #2574 > unrolled thread

Which compilers support GCC expression statements?

Started byLorenzo Caminiti <lorcaminiti@gmail.com>
First post2011-11-29 22:25 -0800
Last post2011-12-02 22:32 -0800
Articles 5 — 5 participants

Back to article view | Back to comp.lang.c++.moderated


Contents

  Which compilers support GCC expression statements? Lorenzo Caminiti <lorcaminiti@gmail.com> - 2011-11-29 22:25 -0800
    Re: Which compilers support GCC expression statements? Dave Abrahams <dave@boostpro.com> - 2011-11-30 12:31 -0800
      Re: Which compilers support GCC expression statements? Miles Bader <miles@gnu.org> - 2011-12-02 22:38 -0800
    Re: Which compilers support GCC expression statements? Arne Mertz <arnemertz@googlemail.com> - 2011-11-30 12:45 -0800
    Re: Which compilers support GCC expression statements? Uwe Dolinsky <uwe@codeplay.com> - 2011-12-02 22:32 -0800

#2574 — Which compilers support GCC expression statements?

FromLorenzo Caminiti <lorcaminiti@gmail.com>
Date2011-11-29 22:25 -0800
SubjectWhich compilers support GCC expression statements?
Message-ID<fb5d7d56-7984-4611-8f5c-5b07283d70e3@cu3g2000vbb.googlegroups.com>
Hello all,

Do you know which compilers support GCC extension for "expression
statements"?
http://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html

int x = ({
    int a = 10;
    a++;
});

I found this list online:
http://stackoverflow.com/questions/6440021/compiler-support-of-gnu-statement-expression

GCC >=3
Intel C++ Compiler >=?
Clang/LLVM >= ?
Sun Studio >= 12 (New Language Extensions)
IBM XL for z/OS (marked as IBM extension)
Open64 (as it use osprey-gcc frontend)
PathScale® EKOPath

Any more? EDG? Comeau?

Thanks a lot.
--Lorenzo


-- 
      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]

[toc] | [next] | [standalone]


#2578

FromDave Abrahams <dave@boostpro.com>
Date2011-11-30 12:31 -0800
Message-ID<m2wrai81i8.fsf@boostpro.com>
In reply to#2574
on Wed Nov 30 2011, Lorenzo Caminiti <lorcaminiti-AT-gmail.com> wrote:

> Hello all,
>
> Do you know which compilers support GCC extension for "expression
> statements"?
> http://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html
>
> int x = ({
>     int a = 10;
>     a++;
> });
>
> I found this list online:
> http://stackoverflow.com/questions/6440021/compiler-support-of-gnu-statement-expression
>
> GCC >=3
> Intel C++ Compiler >=?
> Clang/LLVM >= ?
> Sun Studio >= 12 (New Language Extensions)
> IBM XL for z/OS (marked as IBM extension)
> Open64 (as it use osprey-gcc frontend)
> PathScale® EKOPath
>
> Any more? EDG? Comeau?

I believe Comeau and EDG must support it if Intel does; Intel and Comeau
both use an EDG front-end.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com


      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]

[toc] | [prev] | [next] | [standalone]


#2605

FromMiles Bader <miles@gnu.org>
Date2011-12-02 22:38 -0800
Message-ID<87obvqfzli.fsf@catnip.gol.com>
In reply to#2578
Dave Abrahams <dave@boostpro.com> writes:
>> Any more? EDG? Comeau?
>
> I believe Comeau and EDG must support it if Intel does; Intel and Comeau
> both use an EDG front-end.

Of course, users of the EDG front end can extend it with their own
features as they desire -- the EDG code is pretty easy to hack on --
but EDG has tried pretty hard to support gcc syntax extensions for a
long time, so it almost certainly does support this one, as it's one
of the most useful (I didn't check tho).

-Miles

-- 
Fast, small, soon; pick any 2.


      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]

[toc] | [prev] | [next] | [standalone]


#2581

FromArne Mertz <arnemertz@googlemail.com>
Date2011-11-30 12:45 -0800
Message-ID<6a4a3cbe-bc8b-486e-9a6d-e0abf22272ac@c13g2000vbh.googlegroups.com>
In reply to#2574
On Nov 30, 7:25 am, Lorenzo Caminiti <lorcamin...@gmail.com> wrote:
> Hello all,
>
> Do you know which compilers support GCC extension for "expression
> statements"?http://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html

I don't know about the list, but you can achieve something very
similar on compilers supporting C++11's lambda closures:

int x = ([]->int {
    int a = 10;
    return a++;
});


-- 
      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]

[toc] | [prev] | [next] | [standalone]


#2599

FromUwe Dolinsky <uwe@codeplay.com>
Date2011-12-02 22:32 -0800
Message-ID<59c9474b-ca68-45fc-aacf-69cb2ff1ea86@g7g2000vbd.googlegroups.com>
In reply to#2574
On Nov 30, 6:25 am, Lorenzo Caminiti <lorcamin...@gmail.com> wrote:
> Do you know which compilers support GCC extension for "expression
> statements"?http://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html

Codeplay's Offload C++ compilers (http://offload.codeplay.com/products/
offload/) support expressions statements along with many other gcc
extensions.

-- 
Uwe Dolinsky


      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.c++.moderated


csiph-web