Releases: paul-j-lucas/cdecl
cdecl-11.3
Added explicit-ecsu
option
Both an --explicit-csu
/-S
command-line and explicit-ecsu
set option have been added that set which type keywords enum
, class
, struct
, or union
, are included explicitly in C++ declarations. The default is struct
and
union
only, so:
c++decl> declare ps as pointer to struct S
struct S *ps;
c++decl> declare pt as pointer to class T
T *pt;
Fixed nested array declaration
Explaining a declaration like:
explain int (a)[4]
is now fixed.
cdecl-11.2
More C++ cast checks
const_cast
, dynamic_cast
, and reinterpret_cast
now perform additional checks.
Fixed casting to void
Fixed the ability to cast to void
.
Fixed autocompletion crash
A crash for autocompletion of help options has been fixed.
cdecl-11.1
Multiple declarations
The declare
command can now accept multiple names like:
cdecl> declare p, q as pointer to int
int *p, *q;
Digraph & Trigraph output
Digraphs and trigraphs are no longer emitted in a language in which they aren't supported.
Help options
The help
command now also acceptions options
. Help for options is now printed separately.
Help autocompletion
Help options are now autocompletable.
Fixed multiple nested declarations crash
Explaining a declaration like:
explain int (*p), (*q)
is now fixed.
cdecl-11.0
K&R C function returning struct
Now correctly forbidding functions returning struct
in K&R C.
Digraphs before C95
Either using a digraph or setting the digraphs option in a language before C95 now prints a warning that digraphs are not supported until C95.
Trigraphs in K&R C
Either using a trigraph or setting the trigraphs option in K&R C now prints a warning that trigraphs are not supported until C89.
Optional ()
for destructor
Declaring a destructor in English now optionally allows ()
.
C++23
C++23 is both now allowed for and the default C++ version. However, there are as of yet no differences with respect to declarations between it and C++20.
inline namespace
command
inline
is now a command in C++11 and later (presumed to be followed by namespace
) and namespace
is auto-completable.
Nested inline
namespaces
C++20's nested inline namespaces are now supported:
namespace A::inline B { // ...
show typedef
& show using
autocompletion
The keywords typedef
and using
are now auto-completable.
In-class default
, delete
, and noexcept
constructors
These are now accepted.
static
main()
in C
This is now correctly forbidden.
Fixed C++ raw string literals
A raw string literal like R"abc(X)ab)abc"
was previously not parsed correctly.
Fixed multiple pointers to function having a Microsoft calling convention
Declarations like:
cdecl> explain int (__stdcall **f)()
are now handled correctly.
Fixed typedef
of void
typedef void V
is now correctly allowed and V p
is now correctly flagged as an error.
Fixed pointer to typedef
of reference
Declarations like:
typedef int &RI
explain RI *p
are now correctly flagged as illegal.
Fixed array of reference
An array of reference (or rvalue reference) is now correctly flagged as an error.
Fixed function returning typedef
of array
Declarations like:
typedef int A[2]
explain A f()
are now correctly flagged as illegal.
Fixed "pointer to function returning pointer to array" function argument
A declaration like int f(char (*(*)())[])
is now parsed correctly.
cdecl-10.4
Microsoft calling conventions
Added support for Microsoft calling conventions __cdecl
, __clrcall
, __fastcall
, __stdcall
, __thiscall
, and __vectorcall
.
Partial support for Microsoft's __declspec
Microsoft C's __declspec
syntax is now parsed, but otherwise ignored. (A warning is printed that it's ignored.)
Microsoft __asm
declarations
Now recognizing Microsoft's __asm
just to say it's not supported (just like asm
).
More Microsoft types
Added types __m128
, __m128d
, __m128i
, and __m64
.
Updated GnuLib for gcc 11
Pulled a fix from upstream GnuLib to fix a compile error under gcc 11.
cdecl-10.3
Deleted functions and conversion operators
Marking functions and conversion operators = delete
is now supported.
Improved or fixed error messages
Improved or fixed several error messages.
cdecl-10.2
At most one of virtual
, final
, or override
In C++, at most one of virtual
, final
, or override
is now printed.
Added typedef
to help
typedef
has been added to the "store" section of English help.
Pointers to union
members
Pointers to union
members are now allowed.
using
forbids type
using
declarations now correctly forbid names in the types on the right-hand side:
using U = void (*F)(); // illegal
cdecl-10.1
More robust scoped name type checking
Scoped names' scope-types are now checked against previous declarations. For example, the second declaration's attempted use of N::C
as a namespace is now flagged as an error because it was previously declared as a class:
c++decl> namespace N { class C; }
c++decl> namespace N::C { class D; }
^
11: error: "N::C" was previously declared as a class:
> namespace N { class C; }
More C++ std types
Added types std::chars_format
, std::ctype_base::mask
, std::ios_base
, std::ios_base::event
, std::ios_base::event_callback
, std::ios_base::fmtflags
, std::ios_base::Init
, std::ios_base::iostate
, std::ios_base::openmode
, std::ios_base::seekdir
, std::launch
, std::regex_constants::match_flag_type
, and std::regex_constants::syntax_option_type
.
cdecl-10.0
asm
declarations
Now recognizing asm
just to say it's not supported.
bootstrap
Added a bootstrap
script.
No lexer & parser error messages
When the lexer prints an error message, the parser no longer does.
Improved operator<=>
Now ensuring return type is one of auto
, std::partial_ordering
, std::strong_ordering
, or std::weak_ordering
; and that all parameters are a class or reference thereto.
Default relational operators
Default relational operators in C++20 are now supported.
C++ raw string literals
C++'s raw string literals R"delim(...)delim"
are now supported.
Relaxed main()
checks
If a function named "main" has any storage-like type that can't be used with the program's main()
, assume it's just a member function named "main" and not the program's main()
.
main()
return type
The return type of the program's main()
is now correctly restricted to int
.
makedoc.sh
Added a small script to build the documentation rather than just call Doxygen. The script prints the location of the document root and the local file URL. On macOS, also prints the open
command to run.
register struct
Declaring a struct
as register
is now legal.
cdecl-9.10
** Showing globs**
The show
command now supports globs:
show foo* // Show types starting with foo.
show s::*foo // Show types starting with foo in top-level scope s.
show s*::foo // Show foo types in top-level scopes starting with s.
show **::foo // Show foo types in any scope.
"Did you mean ...?" for command-line options
"Did you mean ...?" suggestions have been added for command-line long options.
C78 in help
Added C78 to help text.
Fixed "null" for unknown name
No longer sometime print "null" when an unknown name is encountered.