diff options
author | Serge Pavlov <sepavloff@gmail.com> | 2013-10-08 16:56:30 +0000 |
---|---|---|
committer | Serge Pavlov <sepavloff@gmail.com> | 2013-10-08 16:56:30 +0000 |
commit | aa57a64ef69c774a37420c79a8d3b50d559c3661 (patch) | |
tree | 6e7c53074974b57ce2300ddecc0cabdcb4352dc2 /clang/test/CXX/expr/expr.unary/expr.sizeof/p1.cpp | |
parent | 016be42362c6b9caa3fd0cbc218257a82bb43491 (diff) | |
download | bcm5719-llvm-aa57a64ef69c774a37420c79a8d3b50d559c3661.tar.gz bcm5719-llvm-aa57a64ef69c774a37420c79a8d3b50d559c3661.zip |
Add fixits suggesting parenthesis around type name in expressions like sizeof.
This fixes PR16992 - Fixit missing when "sizeof type" found.
llvm-svn: 192200
Diffstat (limited to 'clang/test/CXX/expr/expr.unary/expr.sizeof/p1.cpp')
-rw-r--r-- | clang/test/CXX/expr/expr.unary/expr.sizeof/p1.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/CXX/expr/expr.unary/expr.sizeof/p1.cpp b/clang/test/CXX/expr/expr.unary/expr.sizeof/p1.cpp index 77d786568bd..cd0747fce59 100644 --- a/clang/test/CXX/expr/expr.unary/expr.sizeof/p1.cpp +++ b/clang/test/CXX/expr/expr.unary/expr.sizeof/p1.cpp @@ -26,3 +26,23 @@ void test2() { x = sizeof(test2()); // expected-error {{invalid application of 'sizeof' to an incomplete type 'void'}} x = sizeof(test2); // expected-error {{invalid application of 'sizeof' to a function type}} } + +namespace pr16992 { + +template<typename T> struct ABC { + int func () { + return sizeof T; //expected-error{{missed parenthesis around the type name in sizeof}} + } +}; + +ABC<int> qq; + +template<typename T> struct ABC2 { + int func () { + return sizeof T::A; + } +}; + +struct QQ { int A; }; +ABC2<QQ> qq2; +} |