summaryrefslogtreecommitdiff
path: root/test/SemaCXX/implicit-exception-spec.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-11-07 01:14:25 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-11-07 01:14:25 +0000
commitce2661f9ccb85de1aacaa7c3ea414a757f5986f6 (patch)
tree1db7a542b581bc600544d5df6d16bb1dc8fd8244 /test/SemaCXX/implicit-exception-spec.cpp
parent43f4f1e92bb07a04c30c9781be4d0bb5cc30acdd (diff)
downloadclang-ce2661f9ccb85de1aacaa7c3ea414a757f5986f6.tar.gz
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167514 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/implicit-exception-spec.cpp')
-rw-r--r--test/SemaCXX/implicit-exception-spec.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/test/SemaCXX/implicit-exception-spec.cpp b/test/SemaCXX/implicit-exception-spec.cpp
index b29cff5c5d..e26f985f0d 100644
--- a/test/SemaCXX/implicit-exception-spec.cpp
+++ b/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;
};
}