Fix AST representations of alias-declarations which define tag types. Inside classes, the tag types need to have an associated access specifier, and inside function definitions, they need to be included in the declarations of the DeclStmt. These issues manifested as assertions during template instantiation, and also in a WIP constexpr patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134250 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/instantiate-function-2.cpp b/test/SemaTemplate/instantiate-function-2.cpp
index b4c0d9d..21eccd4 100644
--- a/test/SemaTemplate/instantiate-function-2.cpp
+++ b/test/SemaTemplate/instantiate-function-2.cpp
@@ -42,3 +42,17 @@
f<int>(0);
}
}
+
+namespace AliasTagDef {
+ template<typename T>
+ T f() {
+ using S = struct { // expected-warning {{C++0x}}
+ T g() {
+ return T();
+ }
+ };
+ return S().g();
+ }
+
+ int n = f<int>();
+}