diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-11-14 03:27:21 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-11-14 03:27:21 +0000 |
| commit | bf3f322034bdf663665675629c887df00556c726 (patch) | |
| tree | 283b84e3ad4ae54f9dff5c0b3f9f9a3894bde02c /clang/test | |
| parent | 50ec0da0e1dc16dcd720719892efdf912bbdd32e (diff) | |
| download | bcm5719-llvm-bf3f322034bdf663665675629c887df00556c726.tar.gz bcm5719-llvm-bf3f322034bdf663665675629c887df00556c726.zip | |
When type-checking a static cast (or the static_cast part of a C-style
cast) that is converting to a class type, enumerate its constructors
as in any other direct initialization. This ensures that we get the
proper conversion sequence.
llvm-svn: 88751
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/SemaCXX/static-cast.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/static-cast.cpp b/clang/test/SemaCXX/static-cast.cpp index d816c05e3ee..5d4f1bfcdf0 100644 --- a/clang/test/SemaCXX/static-cast.cpp +++ b/clang/test/SemaCXX/static-cast.cpp @@ -144,3 +144,21 @@ namespace pr5261 { }; outer<int> EntryList; } + + +// Initialization by constructor +struct X0; + +struct X1 { + X1(); + X1(X1&); + X1(const X0&); + + operator X0() const; +}; + +struct X0 { }; + +void test_ctor_init() { + (void)static_cast<X1>(X1()); +} |

