summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-02-08 19:58:48 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-02-08 19:58:48 +0000
commit3f846bd9fee78ea8f16b8e90ffcacfcce205a19d (patch)
treef46c190a6b1f66e81ef359e37933479fdbbb3708 /clang/test
parent0674fe39e5a9e4db5bbbb7389c8cb16705de7e07 (diff)
downloadbcm5719-llvm-3f846bd9fee78ea8f16b8e90ffcacfcce205a19d.tar.gz
bcm5719-llvm-3f846bd9fee78ea8f16b8e90ffcacfcce205a19d.zip
Don't crash on 'decltype(auto)::'. Rather than treating it as a meaningless
nested-name-specifier (as the standard appears to require), treat it as the type specifier 'decltype(auto)' followed by a nested-name-specifier starting with '::'. llvm-svn: 294506
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaCXX/cxx1y-deduced-return-type.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/cxx1y-deduced-return-type.cpp b/clang/test/SemaCXX/cxx1y-deduced-return-type.cpp
index 593ec48b439..a061cf4ddb7 100644
--- a/clang/test/SemaCXX/cxx1y-deduced-return-type.cpp
+++ b/clang/test/SemaCXX/cxx1y-deduced-return-type.cpp
@@ -385,6 +385,18 @@ namespace MemberTemplatesWithDeduction {
}
}
+namespace NNS {
+ int n;
+ decltype(auto) i();
+ decltype(n) j();
+ struct X {
+ // We resolve a wording bug here: 'decltype(auto)::' should not be parsed
+ // as a nested-name-specifier.
+ friend decltype(auto) ::NNS::i();
+ friend decltype(n) ::NNS::j(); // expected-error {{not a class}}
+ };
+}
+
namespace CurrentInstantiation {
// PR16875
template<typename T> struct S {
OpenPOWER on IntegriCloud