diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-09-29 23:57:25 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-09-29 23:57:25 +0000 |
commit | ecad4de87bbbac3218bf0b8c1526459b004d7719 (patch) | |
tree | d226e5e1230c6568ba4621bbc3199724a719a4a0 /test/CXX | |
parent | 3b862f67453ad24060274ad29dc28f56a435025a (diff) |
Add a "vexing parse" warning for ambiguity between a variable declaration and a
function-style cast.
This fires for cases such as
T(x);
... where 'x' was previously declared and T is a type. This construct declares
a variable named 'x' rather than the (probably expected) interpretation of a
function-style cast of 'x' to T.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314570 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX')
-rw-r--r-- | test/CXX/basic/basic.lookup/basic.lookup.qual/class.qual/p2.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/CXX/basic/basic.lookup/basic.lookup.qual/class.qual/p2.cpp b/test/CXX/basic/basic.lookup/basic.lookup.qual/class.qual/p2.cpp index 18b18834bb..cf58a85d84 100644 --- a/test/CXX/basic/basic.lookup/basic.lookup.qual/class.qual/p2.cpp +++ b/test/CXX/basic/basic.lookup/basic.lookup.qual/class.qual/p2.cpp @@ -73,6 +73,7 @@ void other_contexts() { int a; { X0::X0(a); // expected-error{{qualified reference to 'X0' is a constructor name rather than a type in this context}} + // expected-warning@-1 {{redundant parentheses around declaration of variable named 'a'}} expected-note@-1 2{{}} } } |