diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/other/cv_func.C')
-rw-r--r-- | gcc/testsuite/g++.dg/other/cv_func.C | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/other/cv_func.C b/gcc/testsuite/g++.dg/other/cv_func.C new file mode 100644 index 000000000..941cb8d53 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/cv_func.C @@ -0,0 +1,30 @@ +// { dg-do compile } + +typedef int FIC(int) const; +typedef int FI(int); + +FIC f; // { dg-error "qualified" } +struct S { + FIC f; // OK + + const FI g; + + int h(int) const; + +}; +FIC S::*pm = &S::f; +const FI S::*pm2 = &S::f; // { dg-error "cannot convert" } +const FIC S::*pm3 = &S::f; + +int S::f(int) const +{ + return 17; +} + + +int foo(float) const // { dg-error "qualifier" } +{ + return 0; +} + +int bar(float) volatile; // { dg-error "qualifier" } |