Releases: paul-j-lucas/cdecl
cdecl-14.2
Autocompletion =
Autocompleting set
options that take a value now includes =
.
-I
changed to -i
The -I
option (--explicit-int
) has been changed to -i
.
-R
changed to -r
The -R
option (--trailing-return
) has been changed to -r
.
"West" pointer types
New --west-pointer
and -w
command-line options and a new west-pointer
set
option allow specification of when to print *
, &
, and &&
adjacent to types ("west"):
int *p; // east
int* p; // west
cdecl-14.1.1
Escaping quotes in dump strings
When dumping, quotes in strings are now properly escaped.
Quoting lambda capture dump strings
When dumping, this
and *this
are now properly quoted.
Fixed operator dump crash
Dumping an operator caused a crash: fixed.
cdecl-14.1
Alternative tokens
Blocks, lambda captures, and reference functions now correctly print alternative tokens when the option is enabled.
Alternative tokens vs. di/trigraphs
If both alternative token and either di/trigraph options are set, alternative tokens now have priority.
C casting without a name
Now allowing C-style casting without a name:
cdecl> cast to pointer to char
(char*)
Di/Trigraphs
Now correctly emitting di/trigraphs for lambda captures and operator[]
.
Debug output
The format of the debug output has been made more JSON5-like.
Limit when q
means quit
The q
command is now recognized as a synonym for quit
only when it's the only thing on a line other than whitespace. This now allows things like:
cdecl> declare p, q as pointer to int
int *p, *q;
to work without complaining that q
is a cdecl keyword.
Trailing return type
New --trailing-return
and -R
command-line options and trailing-return
set
option enable printing a function's or operator's return type using the trailing return type syntax in C++11 and later.
unsigned
in K&R C
Now correctly restrict unsigned
to int
only in K&R C.
Verbose version
If either the --version
or -v
is given twice, additionally prints the set of configure
feature & package options and whether GNU readline (if compiled in) is genuine.
Fixed explicit constructor with unnecessary ()
A declaration like:
explain explicit (C)(int)
that's an explicit constructor with unnecessary ()
caused a crash. Fixed.
cdecl-14.0
Autocompletion bell
When hitting TAB and there are no completion matches, cdecl now rings the terminal's bell.
Cast into array
Now correctly allowing casting into an array when there is no name:
cdecl> explain (char const *const[])
cast into array of constant pointer to constant character
Destructors in C
Cdecl now correctly reports destructors in C as an error.
Digraph & trigraph fixes
The digraphs and trigraphs for {
and }
weren't emitted when they should have been for nested types. The digraphs & trigraphs for {
and }
weren't parsed at all. Both fixed.
Lambdas
Support for C++ lambdas has been added:
c++decl> explain [=,&x](int n)
declare lambda capturing [copy by default, reference to x] (n as integer)
Undid K&R function parameter printed as int
Undid a change in cdecl 11.5 where K&R C typeless function parameters were printed as being of type int
: they now again print as only their names.
cdecl-13.2
Improved autocompletion
In cases where words in pseudo-Engish can only have a limited set of words that follow in the grammar, only those are now suggested.
Array of array check
Now correctly reporting declarations of arrays of incomplete arrays as an error, e.g.:
cdecl> explain void f(int x[][])
^
23: error: array dimension required
Fixed color prompts
Prompts were always being displayed in color even when --color=never
. Fixed.
Function parameter checks
No longer require certain declarations to be function parameters: const
, volatile
, static
, and variable length arrays; [[carries_dependency]]
. This was changed so you can explain an individual function parameter declaration without having to wrap it inside a function declaration.
Autocompletion word-break characters
The set of word-break characters for autocompletion has been expanded to be (almost) all non-identifier characters.
extern void v
C allows you to declare an object of an incomplete type, so C allows:
extern void v
Now cdecl does also.
More English synonyms
The following English synonyms have been added:
bit-precise integer _BitInt
bit precise integer _BitInt
[[no_unique_address]]
bit fields
Bit-fields having [[no_unique_address]]
are now correctly reported as an error.
User-defined literal parameter lists
Fixed requiring parameter list for user-defined literals in English.
cdecl-13.1
auto
type definitions and casts
Defining or casting a type containing auto
is now correctly reported as an error.
C23 auto
Added support for auto
as a deduced type in C23.
C23 trigraphs
Trigraphs are no longer supported in C23.
_BitInt(<int>)
help
_BitInt(<int>)
was added to the help text.
Color prompt
Now printing the prompt in color even when readline is disabled.
More English synonyms
The following English synonyms have been added:
boolean _Bool
Boolean _Bool
char 8 char8_t
char 16 char16_t
char 32 char32_t
const-eval consteval
constant-evaluation consteval
const-expr constexpr
constant-expression constexpr
const-init constinit
constant-initialization constinit
double precision double
floating point float
user defined user-defined
wide character wchar_t
C++ auto
help
auto
is now correctly listed as a C++ type in the help for C++11 and later.
More pseudo-English type names
When explaining gibberish, print types in C/C++ (e.g., int
), not pseudo-English (e.g., integer
).
--no-english-types
, -T
, & english-types
Added command-line options to disable printing type names in pseuso-English and corresponding set
option.
More english for user-defined conversions
User-defined conversions in pseudo-English now allow "const[ant] eval[uation]", "const[ant] expr[ession]", and "const[ant] init[ialization]" for a storage class.
_BitInt
maximum bits
Now check that the maximum number of bits for _BitInt
is 64.
explicit-int
parsing
Fixed a bug of not resetting the current explicit-int
option to none before parsing a new string.
friend
scoped user-defined conversion operators
Explaining a friend
scoped user-defined conversion operator, e.g.:
explain friend C::operator int()
is now parsed correctly.
[[noreturn]]
in C23.
[[noreturn]]
is now printed rather than _Noreturn
in C23.
Invalid destructor name error
Improved the error message for an invalid destructor name, e.g., S::~T
.
Removed --interactive
& -i
options
Removed these command-line options. They've been in cdecl since the beginning, but never seemed to have a justification.
exit
and quit
command line arguments
Both the exit
and quit
commands when given as the first word of the first argument on the command line are now correctly reported as an error.
C23 constexpr
help
Added missing constexpr
to the help for C23.
Missing C++ types man page
Added some missing C++23 types to the manual page.
Octal digit separators
Digit separators are now supported for octal integers.
reproducible
and unsequenced
man page
Added missing reproducible
and unsequenced
to the manual page.
Variadic function parameter
A ...
is now correctly allowed as the only function parameter in C++ as well as C23.
cdecl-13.0
Better copy constructor support
Declarations like:
c++decl> explain C(C const&)
declare C as constructor (reference to constant C)
are now supported better.
C23 alignas
In C23, alignas
is now used instead of _Alignas
.
C23 _BitInt(N)
The _BitInt(N)
type in C23 in now supported.
C23 bool
In C23, bool
is now used instead of _Bool
.
C23 constexpr
The constexpr
storage class in C23 is now supported.
C23 fixed type enum
Fixed-type enumerations in C23 are now supported.
Digit separators
Digit separators are now supported.
C23 reproducible
& unsequenced
These C23 attributes are now supported.
C23 thread_local
In C23, thread_local
is now used instead of _Thread_local
.
C23 true
, false
, nullptr
, static_assert
, & thread_local
These are now also keywords in C23.
C23 typeof
& typeof_unqual
These C23 keywords are now recognized, but not supported by cdecl.
More C++23 standard types
Added the standard C++23 types std::bfloat16_t
, std::float128_t
, std::float16_t
, std::float32_t
, std::float64_t
, std::ospanstream
, std::spanbuf
, std::spanstream
, std::stacktrace
, std::unexpect_t
, std::wospanstream
, std::wspanbuf
, and std::wspanstream
.
Enumeration bit-fields
Enumerations in C++ can now be bit fields.
C++23 explicit object parameters
Explicit object parameters in C++23 are preliminarily supported.
C++ static
operator()
Now allow operator()
to be static
in C++23.
Added std::bernoulli_distribution
and std::random_device
Added these missing C++11 types.
static
or const
array parameters
Both static
or const
array declarations are now additionally recognized outside of function parameters allowing more specific error reporting (since they're still illegal).
C++11 explicit user-defined conversion operators
Explicit user-defined conversion operators are now correctly allowed in C++11 and later.
Echoing commands
A new --echo-commands
/-O
command-line option and echo-commands
set option has been added that echos command given before corresponding output. (This is primarily useful for associating command output with input in test scripts.)
Better alignment error location
Improved the location of alignment errors.
Fixed aligned bit fields
Aligned bit fields are now correctly forbidden.
Fixed noprompt
error column
Fixed the error column when the prompt is disabled.
cdecl-12.0
Added suggestions
Added suggestions to error messages in certain cases when a keyword is expected, for example:
cdecl> declare x as type poiner to int
^
19: syntax error: "poiner": "as" expected; did you mean "pointer"?
Better executable name checking
Previously, if cdecl was invoked as cast
, declare
, or explain
, or with a name that isn't a command (through renaming or a hard or a symbolic link) without command-line arguments, it behaved as if it were invoked as cdecl
without error. This has been fixed.
C23
The placeholder name of C2X has been changed to C23.
Color and TERM
The TERM
environment variable is no longer considered when determining whether color should be used in output. Now, all that matters is whether the output stream is connected to a TTY.
exit
auto-completion
The exit
command is no longer auto-completable enabling explain
to be auto-completed after typing only ex
rather than exp
as before.
help options
types
Help for types was added to options help.
explicit
help
The missing explicit
was added to the help.
explicit-escu
for enum
The explicit-ecsu
option for enums is fixed.
include
Added a new include
command to include cdecl commands from files either from a configuration file or the cdecl command line.
_Noreturn
deprecated
_Noreturn
is now deprecated in C2X.
Printing of types
Now printing types in error messages as they were originally defined (pseudo-English vs. gibberish) in more cases.
Additional sanitizers
The configure
options of --enable-msan
and --enable-ubsan
have been added to enable clang's Memory Sanitizer and Undefined Behavior Sanitizer, respectively. The previous --enable-address-sanitizer
has been renamed to --enable-asan
.
show
autocompletion
The show
command now uses command-specific autocompletion.
Overloading co_await
operator
Overloading the co_await
operator is now supported.
Predefined types
Fixed spelling of bad_typeid
; added source_location
, type_index
, and type_info
.
Types as objects, English edition
Previously declared types in pseudo-Engilsh are now checked to ensure they're not being used as objects:
cdecl> struct S
cdecl> declare S as int // error (now)
cdecl-11.15
_Atomic
arrays
_Atomic
arrays are now correctly forbidden:
typedef int A[2]
explain _Atomic A x // error: _Atomic array of T is illegal
Note that:
_Atomic int x[2]; // OK: array of _Atomic T is legal
is legal.
CDECLRC
environment variable
If none of the --config
, -c
, --no-config
, nor -C
command line options are given and the value of the CDECLRC
environment variable isn't empty, it's used as the full path to the cdeclrc file to read upon start-up.
Configuration file default language
Previously, cdecl would temporarily set the current language to the latest supported version of C++ while reading a configuration file. It no longer does this as a special case. Now, as always, it sets the default language based on the executable name.
enum
alignment in C11
Alignment of enums is now correctly allowed in C11.
Types as objects
Previously declared types are now checked to ensure they're not being used as objects:
cdecl> struct S
cdecl> explain int S // error (now)
cdecl-11.14
Alternative tokens & digraphs
Now prints a warning that neither alternative tokens nor digraphs are supported until C95. Also now printing a warning if alternative tokens are set and the current language changes to one that doesn't support them.
east-const
in K&R C
Now prints a warning that east-const
isn't supported until C89.
using
Now prints a warning that using
isn't supported until C++11.
Fixed void f(int())
The long-standing issue #10 has finally been fixed.
Fixed help message
The old mention of files...
in the help messages was removed.