diff options
author | Jason Merrill <jason@redhat.com> | 2018-06-16 02:35:53 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2018-06-16 02:35:53 -0400 |
commit | 94aedc1c0e27aca2b473c35172b564520a7a63ee (patch) | |
tree | 31f92d67260c8bad14fd3f0b39ef7bd2d8a5dcdb /gcc/testsuite | |
parent | 29305f6018483963fa79b072cf8e95128f3e2cd8 (diff) | |
download | gcc-94aedc1c0e27aca2b473c35172b564520a7a63ee.zip gcc-94aedc1c0e27aca2b473c35172b564520a7a63ee.tar.gz gcc-94aedc1c0e27aca2b473c35172b564520a7a63ee.tar.bz2 |
PR c++/86147 - wrong capture for template argument.
* expr.c (mark_use): Look through NOP_EXPR.
From-SVN: r261676
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const9.C | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const9.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const9.C new file mode 100644 index 0000000..0724ae1 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const9.C @@ -0,0 +1,17 @@ +// PR c++/86147 +// { dg-do compile { target c++11 } } + +template <class T, T N> struct X { }; + +struct A { static constexpr int value = 0; }; + +template<class C> +void foo() { + constexpr int N = C::value; + auto f = [&]{ X<int, N> a; }; +} + +int main() { + foo<A>(); + return 0; +} |