Re: r320089 - Add new language mode flags for C17.

2017-12-07 Thread Ahmed Bougacha via cfe-commits
On Thu, Dec 7, 2017 at 3:05 PM, Aaron Ballman  wrote:
> On Thu, Dec 7, 2017 at 6:00 PM, Aaron Ballman  wrote:
>> On Thu, Dec 7, 2017 at 5:59 PM, Ahmed Bougacha  
>> wrote:
>>> On Thu, Dec 7, 2017 at 2:56 PM, Richard Smith via cfe-commits
>>>  wrote:
 Looks like this might have messed up the line endings in a few files?
>>>
>>> Should be taken care of in r320112.
>>
>> Thanks, I was just getting on that. Sorry about the inadvertent churn there!
>
> I corrected the rest of the line endings in r320113.

Thanks!
-Ahmed

> ~Aaron
>
>>
>> ~Aaron
>>
>>>
>>> -Ahmed
>>>
 On 7 December 2017 at 13:46, Aaron Ballman via cfe-commits
  wrote:
>
> Author: aaronballman
> Date: Thu Dec  7 13:46:26 2017
> New Revision: 320089
>
> URL: http://llvm.org/viewvc/llvm-project?rev=320089&view=rev
> Log:
> Add new language mode flags for C17.
>
> This adds -std=c17, -std=gnu17, and -std=iso9899:2017 as language mode
> flags for C17 and updates the value of __STDC_VERSION__ to the value based
> on the C17 FDIS. Given that this ballot cannot succeed until 2018, it is
> expected that we (and GCC) will add c18 flags as aliases once the ballot
> passes.
>
> Modified:
> cfe/trunk/docs/ReleaseNotes.rst
> cfe/trunk/include/clang/Basic/LangOptions.def
> cfe/trunk/include/clang/Frontend/LangStandard.h
> cfe/trunk/include/clang/Frontend/LangStandards.def
> cfe/trunk/lib/Frontend/CompilerInvocation.cpp
> cfe/trunk/lib/Frontend/InitPreprocessor.cpp
> cfe/trunk/test/Driver/unknown-std.c
>
> Modified: cfe/trunk/docs/ReleaseNotes.rst
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ReleaseNotes.rst?rev=320089&r1=320088&r2=320089&view=diff
>
> ==
> --- cfe/trunk/docs/ReleaseNotes.rst (original)
> +++ cfe/trunk/docs/ReleaseNotes.rst Thu Dec  7 13:46:26 2017
> @@ -121,6 +121,12 @@ New Compiler Flags
>number of attributes are supported outside of C++ mode. See the Clang
>attribute documentation for more information about which attributes are
>supported for each syntax.
> +
> +- Added the ``-std=c17``, ``-std=gnu17``, and ``-std=iso9899:2017``
> language
> +  mode flags for compatibility with GCC. This enables support for the
> next
> +  version of the C standard, expected to be published by ISO in 2018. The
> only
> +  difference between the ``-std=c17`` and ``-std=c11`` language modes is
> the
> +  value of the ``__STDC_VERSION__`` macro, as C17 is a bug fix release.
>
>  Deprecated Compiler Flags
>  -
>
> Modified: cfe/trunk/include/clang/Basic/LangOptions.def
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/LangOptions.def?rev=320089&r1=320088&r2=320089&view=diff
>
> ==
> --- cfe/trunk/include/clang/Basic/LangOptions.def (original)
> +++ cfe/trunk/include/clang/Basic/LangOptions.def Thu Dec  7 13:46:26 2017
> @@ -1,187 +1,188 @@
> -//===--- LangOptions.def - Language option database -*- C++
> -*-===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
>
> -//===--===//
> -//
> -// This file defines the language options. Users of this file must
> -// define the LANGOPT macro to make use of this information.
> -//
> -// Optionally, the user may also define:
> -//
> -// BENIGN_LANGOPT: for options that don't affect the construction of the
> AST in
> -// any way (that is, the value can be different between an implicit
> module
> -// and the user of that module).
> -//
> -// COMPATIBLE_LANGOPT: for options that affect the construction of the
> AST in
> -// a way that doesn't prevent interoperability (that is, the value
> can be
> -// different between an explicit module and the user of that module).
> -//
> -// ENUM_LANGOPT: for options that have enumeration, rather than unsigned,
> type.
> -//
> -// VALUE_LANGOPT: for options that describe a value rather than a flag.
> -//
> -// BENIGN_ENUM_LANGOPT, COMPATIBLE_ENUM_LANGOPT,
> -// BENIGN_VALUE_LANGOPT, COMPATIBLE_VALUE_LANGOPT: combinations of the
> above.
> -//
> -// FIXME: Clients should be able to more easily select whether they want
> -// different levels of compatibility versus how to handle different kinds
> -// of option.
> -//
> -// The Description field should be a noun phrase, for instance "frobbing
> al

Re: r320089 - Add new language mode flags for C17.

2017-12-07 Thread Ahmed Bougacha via cfe-commits
On Thu, Dec 7, 2017 at 3:00 PM, Aaron Ballman  wrote:
> On Thu, Dec 7, 2017 at 5:59 PM, Ahmed Bougacha  
> wrote:
>> On Thu, Dec 7, 2017 at 2:56 PM, Richard Smith via cfe-commits
>>  wrote:
>>> Looks like this might have messed up the line endings in a few files?
>>
>> Should be taken care of in r320112.

Oh, I missed some files.  I'll take care of it.

-Ahmed

> Thanks, I was just getting on that. Sorry about the inadvertent churn there!
>
> ~Aaron
>
>>
>> -Ahmed
>>
>>> On 7 December 2017 at 13:46, Aaron Ballman via cfe-commits
>>>  wrote:

 Author: aaronballman
 Date: Thu Dec  7 13:46:26 2017
 New Revision: 320089

 URL: http://llvm.org/viewvc/llvm-project?rev=320089&view=rev
 Log:
 Add new language mode flags for C17.

 This adds -std=c17, -std=gnu17, and -std=iso9899:2017 as language mode
 flags for C17 and updates the value of __STDC_VERSION__ to the value based
 on the C17 FDIS. Given that this ballot cannot succeed until 2018, it is
 expected that we (and GCC) will add c18 flags as aliases once the ballot
 passes.

 Modified:
 cfe/trunk/docs/ReleaseNotes.rst
 cfe/trunk/include/clang/Basic/LangOptions.def
 cfe/trunk/include/clang/Frontend/LangStandard.h
 cfe/trunk/include/clang/Frontend/LangStandards.def
 cfe/trunk/lib/Frontend/CompilerInvocation.cpp
 cfe/trunk/lib/Frontend/InitPreprocessor.cpp
 cfe/trunk/test/Driver/unknown-std.c

 Modified: cfe/trunk/docs/ReleaseNotes.rst
 URL:
 http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ReleaseNotes.rst?rev=320089&r1=320088&r2=320089&view=diff

 ==
 --- cfe/trunk/docs/ReleaseNotes.rst (original)
 +++ cfe/trunk/docs/ReleaseNotes.rst Thu Dec  7 13:46:26 2017
 @@ -121,6 +121,12 @@ New Compiler Flags
number of attributes are supported outside of C++ mode. See the Clang
attribute documentation for more information about which attributes are
supported for each syntax.
 +
 +- Added the ``-std=c17``, ``-std=gnu17``, and ``-std=iso9899:2017``
 language
 +  mode flags for compatibility with GCC. This enables support for the
 next
 +  version of the C standard, expected to be published by ISO in 2018. The
 only
 +  difference between the ``-std=c17`` and ``-std=c11`` language modes is
 the
 +  value of the ``__STDC_VERSION__`` macro, as C17 is a bug fix release.

  Deprecated Compiler Flags
  -

 Modified: cfe/trunk/include/clang/Basic/LangOptions.def
 URL:
 http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/LangOptions.def?rev=320089&r1=320088&r2=320089&view=diff

 ==
 --- cfe/trunk/include/clang/Basic/LangOptions.def (original)
 +++ cfe/trunk/include/clang/Basic/LangOptions.def Thu Dec  7 13:46:26 2017
 @@ -1,187 +1,188 @@
 -//===--- LangOptions.def - Language option database -*- C++
 -*-===//
 -//
 -// The LLVM Compiler Infrastructure
 -//
 -// This file is distributed under the University of Illinois Open Source
 -// License. See LICENSE.TXT for details.
 -//

 -//===--===//
 -//
 -// This file defines the language options. Users of this file must
 -// define the LANGOPT macro to make use of this information.
 -//
 -// Optionally, the user may also define:
 -//
 -// BENIGN_LANGOPT: for options that don't affect the construction of the
 AST in
 -// any way (that is, the value can be different between an implicit
 module
 -// and the user of that module).
 -//
 -// COMPATIBLE_LANGOPT: for options that affect the construction of the
 AST in
 -// a way that doesn't prevent interoperability (that is, the value
 can be
 -// different between an explicit module and the user of that module).
 -//
 -// ENUM_LANGOPT: for options that have enumeration, rather than unsigned,
 type.
 -//
 -// VALUE_LANGOPT: for options that describe a value rather than a flag.
 -//
 -// BENIGN_ENUM_LANGOPT, COMPATIBLE_ENUM_LANGOPT,
 -// BENIGN_VALUE_LANGOPT, COMPATIBLE_VALUE_LANGOPT: combinations of the
 above.
 -//
 -// FIXME: Clients should be able to more easily select whether they want
 -// different levels of compatibility versus how to handle different kinds
 -// of option.
 -//
 -// The Description field should be a noun phrase, for instance "frobbing
 all
 -// widgets" or "C's implicit blintz feature".

 -//===--===//
 -
 -#ifndef LANGOPT
 -#  error Define the L

Re: r320089 - Add new language mode flags for C17.

2017-12-07 Thread Aaron Ballman via cfe-commits
On Thu, Dec 7, 2017 at 6:00 PM, Aaron Ballman  wrote:
> On Thu, Dec 7, 2017 at 5:59 PM, Ahmed Bougacha  
> wrote:
>> On Thu, Dec 7, 2017 at 2:56 PM, Richard Smith via cfe-commits
>>  wrote:
>>> Looks like this might have messed up the line endings in a few files?
>>
>> Should be taken care of in r320112.
>
> Thanks, I was just getting on that. Sorry about the inadvertent churn there!

I corrected the rest of the line endings in r320113.

~Aaron

>
> ~Aaron
>
>>
>> -Ahmed
>>
>>> On 7 December 2017 at 13:46, Aaron Ballman via cfe-commits
>>>  wrote:

 Author: aaronballman
 Date: Thu Dec  7 13:46:26 2017
 New Revision: 320089

 URL: http://llvm.org/viewvc/llvm-project?rev=320089&view=rev
 Log:
 Add new language mode flags for C17.

 This adds -std=c17, -std=gnu17, and -std=iso9899:2017 as language mode
 flags for C17 and updates the value of __STDC_VERSION__ to the value based
 on the C17 FDIS. Given that this ballot cannot succeed until 2018, it is
 expected that we (and GCC) will add c18 flags as aliases once the ballot
 passes.

 Modified:
 cfe/trunk/docs/ReleaseNotes.rst
 cfe/trunk/include/clang/Basic/LangOptions.def
 cfe/trunk/include/clang/Frontend/LangStandard.h
 cfe/trunk/include/clang/Frontend/LangStandards.def
 cfe/trunk/lib/Frontend/CompilerInvocation.cpp
 cfe/trunk/lib/Frontend/InitPreprocessor.cpp
 cfe/trunk/test/Driver/unknown-std.c

 Modified: cfe/trunk/docs/ReleaseNotes.rst
 URL:
 http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ReleaseNotes.rst?rev=320089&r1=320088&r2=320089&view=diff

 ==
 --- cfe/trunk/docs/ReleaseNotes.rst (original)
 +++ cfe/trunk/docs/ReleaseNotes.rst Thu Dec  7 13:46:26 2017
 @@ -121,6 +121,12 @@ New Compiler Flags
number of attributes are supported outside of C++ mode. See the Clang
attribute documentation for more information about which attributes are
supported for each syntax.
 +
 +- Added the ``-std=c17``, ``-std=gnu17``, and ``-std=iso9899:2017``
 language
 +  mode flags for compatibility with GCC. This enables support for the
 next
 +  version of the C standard, expected to be published by ISO in 2018. The
 only
 +  difference between the ``-std=c17`` and ``-std=c11`` language modes is
 the
 +  value of the ``__STDC_VERSION__`` macro, as C17 is a bug fix release.

  Deprecated Compiler Flags
  -

 Modified: cfe/trunk/include/clang/Basic/LangOptions.def
 URL:
 http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/LangOptions.def?rev=320089&r1=320088&r2=320089&view=diff

 ==
 --- cfe/trunk/include/clang/Basic/LangOptions.def (original)
 +++ cfe/trunk/include/clang/Basic/LangOptions.def Thu Dec  7 13:46:26 2017
 @@ -1,187 +1,188 @@
 -//===--- LangOptions.def - Language option database -*- C++
 -*-===//
 -//
 -// The LLVM Compiler Infrastructure
 -//
 -// This file is distributed under the University of Illinois Open Source
 -// License. See LICENSE.TXT for details.
 -//

 -//===--===//
 -//
 -// This file defines the language options. Users of this file must
 -// define the LANGOPT macro to make use of this information.
 -//
 -// Optionally, the user may also define:
 -//
 -// BENIGN_LANGOPT: for options that don't affect the construction of the
 AST in
 -// any way (that is, the value can be different between an implicit
 module
 -// and the user of that module).
 -//
 -// COMPATIBLE_LANGOPT: for options that affect the construction of the
 AST in
 -// a way that doesn't prevent interoperability (that is, the value
 can be
 -// different between an explicit module and the user of that module).
 -//
 -// ENUM_LANGOPT: for options that have enumeration, rather than unsigned,
 type.
 -//
 -// VALUE_LANGOPT: for options that describe a value rather than a flag.
 -//
 -// BENIGN_ENUM_LANGOPT, COMPATIBLE_ENUM_LANGOPT,
 -// BENIGN_VALUE_LANGOPT, COMPATIBLE_VALUE_LANGOPT: combinations of the
 above.
 -//
 -// FIXME: Clients should be able to more easily select whether they want
 -// different levels of compatibility versus how to handle different kinds
 -// of option.
 -//
 -// The Description field should be a noun phrase, for instance "frobbing
 all
 -// widgets" or "C's implicit blintz feature".

 -//===--===//
 -
 -#ifndef LANGOPT
 -#  error Defin

Re: r320089 - Add new language mode flags for C17.

2017-12-07 Thread Aaron Ballman via cfe-commits
On Thu, Dec 7, 2017 at 5:59 PM, Ahmed Bougacha  wrote:
> On Thu, Dec 7, 2017 at 2:56 PM, Richard Smith via cfe-commits
>  wrote:
>> Looks like this might have messed up the line endings in a few files?
>
> Should be taken care of in r320112.

Thanks, I was just getting on that. Sorry about the inadvertent churn there!

~Aaron

>
> -Ahmed
>
>> On 7 December 2017 at 13:46, Aaron Ballman via cfe-commits
>>  wrote:
>>>
>>> Author: aaronballman
>>> Date: Thu Dec  7 13:46:26 2017
>>> New Revision: 320089
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=320089&view=rev
>>> Log:
>>> Add new language mode flags for C17.
>>>
>>> This adds -std=c17, -std=gnu17, and -std=iso9899:2017 as language mode
>>> flags for C17 and updates the value of __STDC_VERSION__ to the value based
>>> on the C17 FDIS. Given that this ballot cannot succeed until 2018, it is
>>> expected that we (and GCC) will add c18 flags as aliases once the ballot
>>> passes.
>>>
>>> Modified:
>>> cfe/trunk/docs/ReleaseNotes.rst
>>> cfe/trunk/include/clang/Basic/LangOptions.def
>>> cfe/trunk/include/clang/Frontend/LangStandard.h
>>> cfe/trunk/include/clang/Frontend/LangStandards.def
>>> cfe/trunk/lib/Frontend/CompilerInvocation.cpp
>>> cfe/trunk/lib/Frontend/InitPreprocessor.cpp
>>> cfe/trunk/test/Driver/unknown-std.c
>>>
>>> Modified: cfe/trunk/docs/ReleaseNotes.rst
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ReleaseNotes.rst?rev=320089&r1=320088&r2=320089&view=diff
>>>
>>> ==
>>> --- cfe/trunk/docs/ReleaseNotes.rst (original)
>>> +++ cfe/trunk/docs/ReleaseNotes.rst Thu Dec  7 13:46:26 2017
>>> @@ -121,6 +121,12 @@ New Compiler Flags
>>>number of attributes are supported outside of C++ mode. See the Clang
>>>attribute documentation for more information about which attributes are
>>>supported for each syntax.
>>> +
>>> +- Added the ``-std=c17``, ``-std=gnu17``, and ``-std=iso9899:2017``
>>> language
>>> +  mode flags for compatibility with GCC. This enables support for the
>>> next
>>> +  version of the C standard, expected to be published by ISO in 2018. The
>>> only
>>> +  difference between the ``-std=c17`` and ``-std=c11`` language modes is
>>> the
>>> +  value of the ``__STDC_VERSION__`` macro, as C17 is a bug fix release.
>>>
>>>  Deprecated Compiler Flags
>>>  -
>>>
>>> Modified: cfe/trunk/include/clang/Basic/LangOptions.def
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/LangOptions.def?rev=320089&r1=320088&r2=320089&view=diff
>>>
>>> ==
>>> --- cfe/trunk/include/clang/Basic/LangOptions.def (original)
>>> +++ cfe/trunk/include/clang/Basic/LangOptions.def Thu Dec  7 13:46:26 2017
>>> @@ -1,187 +1,188 @@
>>> -//===--- LangOptions.def - Language option database -*- C++
>>> -*-===//
>>> -//
>>> -// The LLVM Compiler Infrastructure
>>> -//
>>> -// This file is distributed under the University of Illinois Open Source
>>> -// License. See LICENSE.TXT for details.
>>> -//
>>>
>>> -//===--===//
>>> -//
>>> -// This file defines the language options. Users of this file must
>>> -// define the LANGOPT macro to make use of this information.
>>> -//
>>> -// Optionally, the user may also define:
>>> -//
>>> -// BENIGN_LANGOPT: for options that don't affect the construction of the
>>> AST in
>>> -// any way (that is, the value can be different between an implicit
>>> module
>>> -// and the user of that module).
>>> -//
>>> -// COMPATIBLE_LANGOPT: for options that affect the construction of the
>>> AST in
>>> -// a way that doesn't prevent interoperability (that is, the value
>>> can be
>>> -// different between an explicit module and the user of that module).
>>> -//
>>> -// ENUM_LANGOPT: for options that have enumeration, rather than unsigned,
>>> type.
>>> -//
>>> -// VALUE_LANGOPT: for options that describe a value rather than a flag.
>>> -//
>>> -// BENIGN_ENUM_LANGOPT, COMPATIBLE_ENUM_LANGOPT,
>>> -// BENIGN_VALUE_LANGOPT, COMPATIBLE_VALUE_LANGOPT: combinations of the
>>> above.
>>> -//
>>> -// FIXME: Clients should be able to more easily select whether they want
>>> -// different levels of compatibility versus how to handle different kinds
>>> -// of option.
>>> -//
>>> -// The Description field should be a noun phrase, for instance "frobbing
>>> all
>>> -// widgets" or "C's implicit blintz feature".
>>>
>>> -//===--===//
>>> -
>>> -#ifndef LANGOPT
>>> -#  error Define the LANGOPT macro to handle language options
>>> -#endif
>>> -
>>> -#ifndef COMPATIBLE_LANGOPT
>>> -#  define COMPATIBLE_LANGOPT(Name, Bits, Default, Description) \
>>> - LANGOPT(Name, Bits, Default, Description)
>>> -#endif
>>> -
>>> -#if

Re: r320089 - Add new language mode flags for C17.

2017-12-07 Thread Ahmed Bougacha via cfe-commits
On Thu, Dec 7, 2017 at 2:56 PM, Richard Smith via cfe-commits
 wrote:
> Looks like this might have messed up the line endings in a few files?

Should be taken care of in r320112.

-Ahmed

> On 7 December 2017 at 13:46, Aaron Ballman via cfe-commits
>  wrote:
>>
>> Author: aaronballman
>> Date: Thu Dec  7 13:46:26 2017
>> New Revision: 320089
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=320089&view=rev
>> Log:
>> Add new language mode flags for C17.
>>
>> This adds -std=c17, -std=gnu17, and -std=iso9899:2017 as language mode
>> flags for C17 and updates the value of __STDC_VERSION__ to the value based
>> on the C17 FDIS. Given that this ballot cannot succeed until 2018, it is
>> expected that we (and GCC) will add c18 flags as aliases once the ballot
>> passes.
>>
>> Modified:
>> cfe/trunk/docs/ReleaseNotes.rst
>> cfe/trunk/include/clang/Basic/LangOptions.def
>> cfe/trunk/include/clang/Frontend/LangStandard.h
>> cfe/trunk/include/clang/Frontend/LangStandards.def
>> cfe/trunk/lib/Frontend/CompilerInvocation.cpp
>> cfe/trunk/lib/Frontend/InitPreprocessor.cpp
>> cfe/trunk/test/Driver/unknown-std.c
>>
>> Modified: cfe/trunk/docs/ReleaseNotes.rst
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ReleaseNotes.rst?rev=320089&r1=320088&r2=320089&view=diff
>>
>> ==
>> --- cfe/trunk/docs/ReleaseNotes.rst (original)
>> +++ cfe/trunk/docs/ReleaseNotes.rst Thu Dec  7 13:46:26 2017
>> @@ -121,6 +121,12 @@ New Compiler Flags
>>number of attributes are supported outside of C++ mode. See the Clang
>>attribute documentation for more information about which attributes are
>>supported for each syntax.
>> +
>> +- Added the ``-std=c17``, ``-std=gnu17``, and ``-std=iso9899:2017``
>> language
>> +  mode flags for compatibility with GCC. This enables support for the
>> next
>> +  version of the C standard, expected to be published by ISO in 2018. The
>> only
>> +  difference between the ``-std=c17`` and ``-std=c11`` language modes is
>> the
>> +  value of the ``__STDC_VERSION__`` macro, as C17 is a bug fix release.
>>
>>  Deprecated Compiler Flags
>>  -
>>
>> Modified: cfe/trunk/include/clang/Basic/LangOptions.def
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/LangOptions.def?rev=320089&r1=320088&r2=320089&view=diff
>>
>> ==
>> --- cfe/trunk/include/clang/Basic/LangOptions.def (original)
>> +++ cfe/trunk/include/clang/Basic/LangOptions.def Thu Dec  7 13:46:26 2017
>> @@ -1,187 +1,188 @@
>> -//===--- LangOptions.def - Language option database -*- C++
>> -*-===//
>> -//
>> -// The LLVM Compiler Infrastructure
>> -//
>> -// This file is distributed under the University of Illinois Open Source
>> -// License. See LICENSE.TXT for details.
>> -//
>>
>> -//===--===//
>> -//
>> -// This file defines the language options. Users of this file must
>> -// define the LANGOPT macro to make use of this information.
>> -//
>> -// Optionally, the user may also define:
>> -//
>> -// BENIGN_LANGOPT: for options that don't affect the construction of the
>> AST in
>> -// any way (that is, the value can be different between an implicit
>> module
>> -// and the user of that module).
>> -//
>> -// COMPATIBLE_LANGOPT: for options that affect the construction of the
>> AST in
>> -// a way that doesn't prevent interoperability (that is, the value
>> can be
>> -// different between an explicit module and the user of that module).
>> -//
>> -// ENUM_LANGOPT: for options that have enumeration, rather than unsigned,
>> type.
>> -//
>> -// VALUE_LANGOPT: for options that describe a value rather than a flag.
>> -//
>> -// BENIGN_ENUM_LANGOPT, COMPATIBLE_ENUM_LANGOPT,
>> -// BENIGN_VALUE_LANGOPT, COMPATIBLE_VALUE_LANGOPT: combinations of the
>> above.
>> -//
>> -// FIXME: Clients should be able to more easily select whether they want
>> -// different levels of compatibility versus how to handle different kinds
>> -// of option.
>> -//
>> -// The Description field should be a noun phrase, for instance "frobbing
>> all
>> -// widgets" or "C's implicit blintz feature".
>>
>> -//===--===//
>> -
>> -#ifndef LANGOPT
>> -#  error Define the LANGOPT macro to handle language options
>> -#endif
>> -
>> -#ifndef COMPATIBLE_LANGOPT
>> -#  define COMPATIBLE_LANGOPT(Name, Bits, Default, Description) \
>> - LANGOPT(Name, Bits, Default, Description)
>> -#endif
>> -
>> -#ifndef BENIGN_LANGOPT
>> -#  define BENIGN_LANGOPT(Name, Bits, Default, Description) \
>> - COMPATIBLE_LANGOPT(Name, Bits, Default, Description)
>> -#endif
>> -
>> -#ifndef ENUM_LANGOPT
>> -#  define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
>> - LANG

r320089 - Add new language mode flags for C17.

2017-12-07 Thread Aaron Ballman via cfe-commits
Author: aaronballman
Date: Thu Dec  7 13:46:26 2017
New Revision: 320089

URL: http://llvm.org/viewvc/llvm-project?rev=320089&view=rev
Log:
Add new language mode flags for C17.

This adds -std=c17, -std=gnu17, and -std=iso9899:2017 as language mode flags 
for C17 and updates the value of __STDC_VERSION__ to the value based on the C17 
FDIS. Given that this ballot cannot succeed until 2018, it is expected that we 
(and GCC) will add c18 flags as aliases once the ballot passes.

Modified:
cfe/trunk/docs/ReleaseNotes.rst
cfe/trunk/include/clang/Basic/LangOptions.def
cfe/trunk/include/clang/Frontend/LangStandard.h
cfe/trunk/include/clang/Frontend/LangStandards.def
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
cfe/trunk/lib/Frontend/InitPreprocessor.cpp
cfe/trunk/test/Driver/unknown-std.c

Modified: cfe/trunk/docs/ReleaseNotes.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ReleaseNotes.rst?rev=320089&r1=320088&r2=320089&view=diff
==
--- cfe/trunk/docs/ReleaseNotes.rst (original)
+++ cfe/trunk/docs/ReleaseNotes.rst Thu Dec  7 13:46:26 2017
@@ -121,6 +121,12 @@ New Compiler Flags
   number of attributes are supported outside of C++ mode. See the Clang
   attribute documentation for more information about which attributes are
   supported for each syntax.
+  
+- Added the ``-std=c17``, ``-std=gnu17``, and ``-std=iso9899:2017`` language
+  mode flags for compatibility with GCC. This enables support for the next
+  version of the C standard, expected to be published by ISO in 2018. The only
+  difference between the ``-std=c17`` and ``-std=c11`` language modes is the
+  value of the ``__STDC_VERSION__`` macro, as C17 is a bug fix release.
 
 Deprecated Compiler Flags
 -

Modified: cfe/trunk/include/clang/Basic/LangOptions.def
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/LangOptions.def?rev=320089&r1=320088&r2=320089&view=diff
==
--- cfe/trunk/include/clang/Basic/LangOptions.def (original)
+++ cfe/trunk/include/clang/Basic/LangOptions.def Thu Dec  7 13:46:26 2017
@@ -1,187 +1,188 @@
-//===--- LangOptions.def - Language option database -*- C++ 
-*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===--===//
-//
-// This file defines the language options. Users of this file must
-// define the LANGOPT macro to make use of this information.
-//
-// Optionally, the user may also define:
-//
-// BENIGN_LANGOPT: for options that don't affect the construction of the AST in
-// any way (that is, the value can be different between an implicit module
-// and the user of that module).
-//
-// COMPATIBLE_LANGOPT: for options that affect the construction of the AST in
-// a way that doesn't prevent interoperability (that is, the value can be
-// different between an explicit module and the user of that module).
-//
-// ENUM_LANGOPT: for options that have enumeration, rather than unsigned, type.
-//
-// VALUE_LANGOPT: for options that describe a value rather than a flag.
-//
-// BENIGN_ENUM_LANGOPT, COMPATIBLE_ENUM_LANGOPT,
-// BENIGN_VALUE_LANGOPT, COMPATIBLE_VALUE_LANGOPT: combinations of the above.
-//
-// FIXME: Clients should be able to more easily select whether they want
-// different levels of compatibility versus how to handle different kinds
-// of option.
-//
-// The Description field should be a noun phrase, for instance "frobbing all
-// widgets" or "C's implicit blintz feature".
-//===--===//
-
-#ifndef LANGOPT
-#  error Define the LANGOPT macro to handle language options
-#endif
-
-#ifndef COMPATIBLE_LANGOPT
-#  define COMPATIBLE_LANGOPT(Name, Bits, Default, Description) \
- LANGOPT(Name, Bits, Default, Description)
-#endif
-
-#ifndef BENIGN_LANGOPT
-#  define BENIGN_LANGOPT(Name, Bits, Default, Description) \
- COMPATIBLE_LANGOPT(Name, Bits, Default, Description)
-#endif
-
-#ifndef ENUM_LANGOPT
-#  define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
- LANGOPT(Name, Bits, Default, Description)
-#endif
-
-#ifndef COMPATIBLE_ENUM_LANGOPT
-#  define COMPATIBLE_ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
- ENUM_LANGOPT(Name, Type, Bits, Default, Description)
-#endif
-
-#ifndef BENIGN_ENUM_LANGOPT
-#  define BENIGN_ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
- COMPATIBLE_ENUM_LANGOPT(Name, Type, Bits, Default, Description)
-#endif
-
-#ifndef VALUE_LANGOPT
-#  define VALUE_LANGOPT(Name, Bits, Default, Description) \
- LANGOPT(Name, Bits, Default, Description)
-#endif
-
-#ifndef COMPATIBLE_VALUE_LANGOPT
-#  define COMPATIBLE_