diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-05-14 19:10:42 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-05-14 19:10:42 +0000 |
commit | a462b4c9acd157fe2e29e739faa899024089c4bb (patch) | |
tree | 42cac85719609d08a123953ce9dffb275dd30e13 /clang/test | |
parent | 2d5814c2d4123bbf6e647d5550f1a9add141df2f (diff) | |
download | bcm5719-llvm-a462b4c9acd157fe2e29e739faa899024089c4bb.tar.gz bcm5719-llvm-a462b4c9acd157fe2e29e739faa899024089c4bb.zip |
DR295: cv-qualifiers on function types are ignored in C++.
llvm-svn: 237383
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CXX/drs/dr2xx.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/clang/test/CXX/drs/dr2xx.cpp b/clang/test/CXX/drs/dr2xx.cpp index bb1f13ac64e..25c853590ae 100644 --- a/clang/test/CXX/drs/dr2xx.cpp +++ b/clang/test/CXX/drs/dr2xx.cpp @@ -999,15 +999,20 @@ namespace dr294 { // dr294: no } } -namespace dr295 { // dr295: no +namespace dr295 { // dr295: 3.7 typedef int f(); - // FIXME: This warning is incorrect. - const f g; // expected-warning {{unspecified behavior}} - const f &r = g; // expected-warning {{unspecified behavior}} + const f g; // expected-warning {{'const' qualifier on function type 'f' (aka 'int ()') has no effect}} + f &r = g; template<typename T> struct X { const T &f; }; - X<f> x = {g}; // FIXME: expected-error {{drops qualifiers}} + X<f> x = {g}; + + typedef int U(); + typedef const U U; // expected-warning {{'const' qualifier on function type 'U' (aka 'int ()') has no effect}} + + typedef int (*V)(); + typedef volatile U *V; // expected-warning {{'volatile' qualifier on function type 'U' (aka 'int ()') has no effect}} } namespace dr296 { // dr296: yes |