diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-07 01:14:25 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-07 01:14:25 +0000 |
| commit | e10d304d204f6c5f4f280019f97b66227cb43162 (patch) | |
| tree | 9b49dea1a1cd14f226607ee2dd9b577c864aa1bf /clang/test/SemaCXX | |
| parent | e030a63868484a6738b10b5ecb224e5fe0ab8c67 (diff) | |
| download | bcm5719-llvm-e10d304d204f6c5f4f280019f97b66227cb43162.tar.gz bcm5719-llvm-e10d304d204f6c5f4f280019f97b66227cb43162.zip | |
PR11851 (and duplicates): Whenever a constexpr function is referenced,
instantiate it if it can be instantiated and implicitly define it if it can be
implicitly defined. This matches g++'s approach. Remove some cases from
SemaOverload which were marking functions as referenced when just planning how
overload resolution would proceed; such cases are not actually references.
llvm-svn: 167514
Diffstat (limited to 'clang/test/SemaCXX')
| -rw-r--r-- | clang/test/SemaCXX/constant-expression-cxx11.cpp | 5 | ||||
| -rw-r--r-- | clang/test/SemaCXX/implicit-exception-spec.cpp | 11 |
2 files changed, 7 insertions, 9 deletions
diff --git a/clang/test/SemaCXX/constant-expression-cxx11.cpp b/clang/test/SemaCXX/constant-expression-cxx11.cpp index 0dd7ffe5a9a..f504eb621f6 100644 --- a/clang/test/SemaCXX/constant-expression-cxx11.cpp +++ b/clang/test/SemaCXX/constant-expression-cxx11.cpp @@ -1451,6 +1451,7 @@ namespace PR14203 { } // FIXME: It's unclear whether this is valid. On the one hand, we're not // allowed to generate a move constructor. On the other hand, if we did, - // this would be a constant expression. - int n = sizeof(short{duration(duration())}); // expected-error {{non-constant-expression cannot be narrowed}} expected-note {{override}} + // this would be a constant expression. For now, we generate a move + // constructor here. + int n = sizeof(short{duration(duration())}); } diff --git a/clang/test/SemaCXX/implicit-exception-spec.cpp b/clang/test/SemaCXX/implicit-exception-spec.cpp index b29cff5c5d1..e26f985f0d0 100644 --- a/clang/test/SemaCXX/implicit-exception-spec.cpp +++ b/clang/test/SemaCXX/implicit-exception-spec.cpp @@ -30,20 +30,17 @@ namespace InClassInitializers { bool x = noexcept(TemplateArg()); // And within a nested class. - // FIXME: The diagnostic location is terrible here. - struct Nested { + struct Nested { // expected-error {{cannot be used by non-static data member initializer}} struct Inner { - int n = ExceptionIf<noexcept(Nested())>::f(); - } inner; // expected-error {{cannot be used by non-static data member initializer}} + int n = ExceptionIf<noexcept(Nested())>::f(); // expected-note {{implicit default constructor for 'InClassInitializers::Nested' first required here}} + } inner; }; - bool y = noexcept(Nested()); - bool z = noexcept(Nested::Inner()); struct Nested2 { struct Inner; int n = Inner().n; // expected-error {{cannot be used by non-static data member initializer}} struct Inner { - int n = ExceptionIf<noexcept(Nested())>::f(); + int n = ExceptionIf<noexcept(Nested2())>::f(); } inner; }; } |

