From: Paolo Carlini Date: Wed, 22 May 2019 08:23:07 +0000 (+0000) Subject: decltype-pr66548.C: Reinstate correct version. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fc907923f19ce950ff418faf27739d5d65678457;p=gcc.git decltype-pr66548.C: Reinstate correct version. 2019-05-22 Paolo Carlini * g++.dg/cpp0x/decltype-pr66548.C: Reinstate correct version. From-SVN: r271507 --- diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype-pr66548.C b/gcc/testsuite/g++.dg/cpp0x/decltype-pr66548.C new file mode 100644 index 00000000000..93a7d490f2f --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/decltype-pr66548.C @@ -0,0 +1,21 @@ +// PR c++/66548 - Invalid class member access expression in decltype +// sometimes accepted +// { dg-do compile } +// { dg-options "-ftrack-macro-expansion=0" } + +#if __cplusplus < 201103L +# define decltype __typeof__ +#endif + +struct Meow {}; + +void f () +{ + decltype (Meow.purr ()) d; // { dg-error "expected primary-expression" "pr89875" { xfail c++98_only } } + (void)&d; +} + +void g () +{ + decltype (Meow.purr); // { dg-error "expected primary-expression" } +}