http://llvm.org/bugs/show_bug.cgi?id=15156

            Bug ID: 15156
           Summary: Unjustified vexing-parse
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

clang version 3.3 (trunk 173433)
Target: x86_64-unknown-linux-gnu
Thread model: posix

Hi

Compiling the following code results in a warning.

struct C
{
    C(int) {};
};

struct D
{
    D(C) {}
};

void a(int b)
{
  D d( C(b) );
}


a.cpp:13:6: warning: parentheses were disambiguated as a function declaration
[-Wvexing-parse]
  D d( C(b) );
     ^~~~~~~~
a.cpp:13:8: note: add a pair of parentheses to declare a variable
  D d( C(b) );
       ^
       (   )
1 warning generated.


In my opinion there is no parse ambiguity because "b" names a concrete object.
I await the verdict of the language lawyers. ;)

Take care
Peter

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to