diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-07-01 19:46:12 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-07-01 19:46:12 +0000 |
commit | cd1c0555286ff5aec940802f27a46fd1bae8aee7 (patch) | |
tree | 8f6710ea14d2afb67546b41113b8930925f18fff /clang/test | |
parent | 5a33687da07cb8ffc68ef5065ed46bab5c4d6555 (diff) | |
download | bcm5719-llvm-cd1c0555286ff5aec940802f27a46fd1bae8aee7.tar.gz bcm5719-llvm-cd1c0555286ff5aec940802f27a46fd1bae8aee7.zip |
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.
llvm-svn: 134250
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/SemaTemplate/instantiate-function-2.cpp | 14 | ||||
-rw-r--r-- | clang/test/SemaTemplate/instantiate-member-class.cpp | 14 |
2 files changed, 28 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-function-2.cpp b/clang/test/SemaTemplate/instantiate-function-2.cpp index b4c0d9d6393..21eccd49013 100644 --- a/clang/test/SemaTemplate/instantiate-function-2.cpp +++ b/clang/test/SemaTemplate/instantiate-function-2.cpp @@ -42,3 +42,17 @@ namespace PR9654 { 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>(); +} diff --git a/clang/test/SemaTemplate/instantiate-member-class.cpp b/clang/test/SemaTemplate/instantiate-member-class.cpp index 74c2609dcd0..1028b45cc0e 100644 --- a/clang/test/SemaTemplate/instantiate-member-class.cpp +++ b/clang/test/SemaTemplate/instantiate-member-class.cpp @@ -104,3 +104,17 @@ namespace test2 { }; template class C<int>; } + +namespace AliasTagDef { + template<typename T> + struct F { + using S = struct U { // expected-warning {{C++0x}} + T g() { + return T(); + } + }; + }; + + int m = F<int>::S().g(); + int n = F<int>::U().g(); +} |