diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2012-02-20 23:58:14 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2012-02-20 23:58:14 +0000 |
| commit | 932b0b1a131b234853fbae7732c6736966e7eba7 (patch) | |
| tree | ce43989b3dc7a298bcb341a2ef0875b832b3a845 /clang/test/CXX | |
| parent | 969fdfddd2bccc939bf0c77d2c381231e5dc3b78 (diff) | |
| download | bcm5719-llvm-932b0b1a131b234853fbae7732c6736966e7eba7.tar.gz bcm5719-llvm-932b0b1a131b234853fbae7732c6736966e7eba7.zip | |
Make RequireLiteralType work correctly with incomplete array types. PR12037.
llvm-svn: 151005
Diffstat (limited to 'clang/test/CXX')
| -rw-r--r-- | clang/test/CXX/basic/basic.types/p10.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/CXX/basic/basic.types/p10.cpp b/clang/test/CXX/basic/basic.types/p10.cpp index 7641e09f61e..83b910b6064 100644 --- a/clang/test/CXX/basic/basic.types/p10.cpp +++ b/clang/test/CXX/basic/basic.types/p10.cpp @@ -11,8 +11,25 @@ constexpr int f1(double) { return 0; } struct S { S(); }; constexpr int f2(S &) { return 0; } +// FIXME: I'm not entirely sure whether the following is legal or not... +struct BeingDefined; +extern BeingDefined beingdefined; +struct BeingDefined { + static constexpr BeingDefined& t = beingdefined; +}; + // - a class type that has all of the following properties: +// (implied) - it is complete + +struct Incomplete; +template<class T> struct ClassTemp {}; + +constexpr Incomplete incomplete = {}; // expected-error {{constexpr variable cannot have non-literal type 'const Incomplete'}} +constexpr Incomplete incomplete2[] = {}; // expected-error {{constexpr variable cannot have non-literal type 'Incomplete const[]'}} +constexpr ClassTemp<int> classtemplate = {}; +constexpr ClassTemp<int> classtemplate2[] = {}; + // - it has a trivial destructor struct UserProvDtor { constexpr int f(); // expected-error {{non-literal type 'UserProvDtor' cannot have constexpr members}} |

