summaryrefslogtreecommitdiff
path: root/test/SemaTemplate
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2013-10-22 21:56:38 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2013-10-22 21:56:38 +0000
commit255ca71082810ac8d3084f43727675e02a384683 (patch)
treebe32dfecaf12d7ae13c610d4d5e3b7c66766d9bb /test/SemaTemplate
parent65f958dca64ef64d43bf85e871ec64e638ff2602 (diff)
downloadclang-255ca71082810ac8d3084f43727675e02a384683.tar.gz
Sema: Allow IndirectFieldDecl to appear in a non-type template argument
We would not identify pointer-to-member construction in a non-type template argument if it was either a FieldDecl or a CXXMethodDecl. However, this would incorrectly reject declarations that were injected via an IndirectFieldDecl (e.g. a field inside of an anonymous union). This fixes PR17657. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193203 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate')
-rw-r--r--test/SemaTemplate/temp_arg_nontype.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/SemaTemplate/temp_arg_nontype.cpp b/test/SemaTemplate/temp_arg_nontype.cpp
index 4a75b11c42..fcdfd458f3 100644
--- a/test/SemaTemplate/temp_arg_nontype.cpp
+++ b/test/SemaTemplate/temp_arg_nontype.cpp
@@ -75,6 +75,9 @@ struct Z {
int int_member;
float float_member;
+ union {
+ int union_member;
+ };
};
template<int (Z::*pmf)(int)> struct A6; // expected-note{{template parameter is declared here}}
A6<&Z::foo> *a17_1;
@@ -88,6 +91,7 @@ A7<&Z::int_member> *a18_1;
A7c<&Z::int_member> *a18_2;
A7<&Z::float_member> *a18_3; // expected-error{{non-type template argument of type 'float Z::*' cannot be converted to a value of type 'int Z::*'}}
A7c<(&Z::int_member)> *a18_4; // expected-warning{{address non-type template argument cannot be surrounded by parentheses}}
+A7c<&Z::union_member> *a18_5;
template<unsigned char C> struct Overflow; // expected-note{{template parameter is declared here}}