diff options
author | David Majnemer <david.majnemer@gmail.com> | 2013-10-26 05:02:13 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2013-10-26 05:02:13 +0000 |
commit | d7b485599cf23605e0e7e9846a7c5df11783b9f7 (patch) | |
tree | 9306d01bb1c108971d51feb509a3fe2d92c2e31f /test/SemaTemplate/temp_arg_nontype.cpp | |
parent | 942e02ba28b490ff2de6bead6f1dae51abf98b66 (diff) | |
download | clang-d7b485599cf23605e0e7e9846a7c5df11783b9f7.tar.gz clang-d7b485599cf23605e0e7e9846a7c5df11783b9f7.tar.bz2 clang-d7b485599cf23605e0e7e9846a7c5df11783b9f7.tar.xz |
Sema: Correctly build pointer-to-member arguments from a template argument with an IndirectFieldDecl
We only considered FieldDecl and CXXMethodDecl as appropriate which
would cause us to believe the IndirectFieldDecl corresponded to an
argument of it's field type instead of a pointer-to-member type.
This fixes PR17696.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193461 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/temp_arg_nontype.cpp')
-rw-r--r-- | test/SemaTemplate/temp_arg_nontype.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/SemaTemplate/temp_arg_nontype.cpp b/test/SemaTemplate/temp_arg_nontype.cpp index fcdfd458f3..8f6cc192fa 100644 --- a/test/SemaTemplate/temp_arg_nontype.cpp +++ b/test/SemaTemplate/temp_arg_nontype.cpp @@ -350,3 +350,17 @@ namespace rdar13806270 { }; void foo() {} } + +namespace PR17696 { + struct a { + union { + int i; + }; + }; + + template <int (a::*p)> struct b : a { + b() { this->*p = 0; } + }; + + b<&a::i> c; // okay +} |